|
41 | 41 | # writes the seeded fuzz corpora (generated/), which aren't checked in. |
42 | 42 | - name: Check vectors are current |
43 | 43 | run: pnpm --filter zero-conformance run test |
| 44 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 45 | + with: |
| 46 | + name: generated-vectors |
| 47 | + path: packages/zero-conformance/generated/ |
| 48 | + if-no-files-found: error |
| 49 | + |
| 50 | + # Separate from the vectors job, which Swift (Linux) waits on. |
| 51 | + cli: |
| 52 | + name: zero-swift CLI |
| 53 | + runs-on: ubuntu-latest |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 56 | + with: |
| 57 | + persist-credentials: false |
| 58 | + - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 |
| 59 | + with: |
| 60 | + version: 11.11.0 |
| 61 | + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 |
| 62 | + with: |
| 63 | + node-version-file: .nvmrc |
| 64 | + package-manager-cache: false |
| 65 | + - run: pnpm install --frozen-lockfile |
44 | 66 | # The Swift tests compile the Swift that zero-swift generates, and check |
45 | 67 | # the Swift ports of apps against the drift vectors it records. |
46 | 68 | - name: Check generated Swift and drift vectors are current |
|
50 | 72 | # The published CLI is a bundle; this keeps it bundling. |
51 | 73 | - name: Build the zero-swift CLI |
52 | 74 | run: pnpm --filter zero-swift run build |
53 | | - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
54 | | - with: |
55 | | - name: generated-vectors |
56 | | - path: packages/zero-conformance/generated/ |
57 | | - if-no-files-found: error |
58 | 75 |
|
59 | 76 | linux: |
60 | 77 | name: Swift (Linux) |
@@ -84,21 +101,63 @@ jobs: |
84 | 101 | # Apple-only; swift-macos.yml checks it. |
85 | 102 | - name: Docs |
86 | 103 | run: scripts/docs.sh Zero ZeroTesting |
87 | | - # Fails on a public API break since the last release that no changeset |
88 | | - # declares. The checkout belongs to another user in the container. |
| 104 | + |
| 105 | + # Fails on a public API break since the last release that no changeset |
| 106 | + # declares. |
| 107 | + api-breaks: |
| 108 | + name: Swift API breaks (Linux) |
| 109 | + runs-on: ubuntu-latest |
| 110 | + container: swift:6.2.4-bookworm |
| 111 | + defaults: |
| 112 | + run: |
| 113 | + working-directory: swift |
| 114 | + steps: |
| 115 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 116 | + with: |
| 117 | + persist-credentials: false |
| 118 | + - name: Install system libraries |
| 119 | + run: apt-get update && apt-get install -y --no-install-recommends libsqlite3-dev jq |
| 120 | + - name: Find the baseline |
| 121 | + id: baseline |
| 122 | + run: | |
| 123 | + tag=$(git ls-remote --tags --refs https://github.com/wevm/zero-swift.git | |
| 124 | + sed 's|.*refs/tags/||' | sort -V | tail -1) |
| 125 | + echo "tag=$tag" >> "$GITHUB_OUTPUT" |
| 126 | + # The baseline's API dumps, which only change with a release. |
| 127 | + - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 |
| 128 | + with: |
| 129 | + path: api-baseline |
| 130 | + key: swift-api-baseline-linux-6.2.4-${{ steps.baseline.outputs.tag }} |
| 131 | + # The checkout belongs to another user in the container. |
89 | 132 | - name: API breaks |
| 133 | + env: |
| 134 | + BASELINE: ${{ steps.baseline.outputs.tag }} |
90 | 135 | run: | |
91 | 136 | git config --global --add safe.directory "$GITHUB_WORKSPACE" |
92 | | - scripts/api-breaks.sh |
93 | | - # zbugs' Swift port, checked against zbugs' TS queries and mutators on |
94 | | - # the samples in drift-samples.ts (the vectors job checks the record is |
95 | | - # current). |
96 | | - - name: zbugs |
| 137 | + API_BREAKS_BASELINE_DIR="$GITHUB_WORKSPACE/api-baseline" \ |
| 138 | + scripts/api-breaks.sh "$BASELINE" |
| 139 | +
|
| 140 | + # zbugs' Swift port, checked against zbugs' TS queries and mutators on the |
| 141 | + # samples in drift-samples.ts (the cli job checks the record is current). |
| 142 | + zbugs: |
| 143 | + name: zbugs (Linux) |
| 144 | + runs-on: ubuntu-latest |
| 145 | + container: swift:6.2.4-bookworm |
| 146 | + defaults: |
| 147 | + run: |
97 | 148 | working-directory: apps/zbugs-swift |
98 | | - run: | |
99 | | - swift format lint --strict --recursive Sources Tests Package.swift |
100 | | - swift build --build-tests |
101 | | - swift test --skip-build |
| 149 | + steps: |
| 150 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 151 | + with: |
| 152 | + persist-credentials: false |
| 153 | + - name: Install system libraries |
| 154 | + run: apt-get update && apt-get install -y --no-install-recommends libsqlite3-dev |
| 155 | + - name: Format |
| 156 | + run: swift format lint --strict --recursive Sources Tests Package.swift |
| 157 | + - name: Build |
| 158 | + run: swift build --build-tests |
| 159 | + - name: Test |
| 160 | + run: swift test --skip-build |
102 | 161 |
|
103 | 162 | e2e: |
104 | 163 | name: Swift end-to-end (Linux) |
|
0 commit comments