|
13 | 13 | build: |
14 | 14 | name: ${{ matrix.os }} |
15 | 15 | runs-on: ${{ matrix.os }} |
16 | | - timeout-minutes: 20 |
| 16 | + timeout-minutes: 45 |
17 | 17 | strategy: |
18 | 18 | fail-fast: false |
19 | 19 | matrix: |
@@ -59,18 +59,47 @@ jobs: |
59 | 59 | plutil -lint "$plist" |
60 | 60 |
|
61 | 61 | - run: npm ci |
62 | | - - run: npm run compliance:licenses |
| 62 | + - name: Cache compliance source downloads |
| 63 | + uses: actions/cache@v4 |
| 64 | + with: |
| 65 | + path: .compliance-cache |
| 66 | + key: compliance-${{ runner.os }}-${{ hashFiles('third_party/compliance-policy.json') }} |
| 67 | + restore-keys: compliance-${{ runner.os }}- |
| 68 | + |
| 69 | + # macOS arm64 is a release target, so it must be able to produce the complete |
| 70 | + # corresponding-source bundle. Linux installs from source and only needs the |
| 71 | + # license inventory. |
| 72 | + - name: Prepare compliance materials (release target) |
| 73 | + if: runner.os == 'macOS' |
| 74 | + run: npm run compliance:prepare |
| 75 | + - name: Prepare compliance licenses (source-install platform) |
| 76 | + if: runner.os != 'macOS' |
| 77 | + run: npm run compliance:licenses |
63 | 78 | - name: Verify platform license coverage |
64 | 79 | run: | |
65 | 80 | node --input-type=module -e " |
66 | 81 | import { existsSync, readFileSync } from 'node:fs'; |
67 | 82 | const inventory = JSON.parse(readFileSync('.compliance/LICENSE-INVENTORY.json')); |
68 | 83 | const libvips = inventory.packages.find(({ name }) => |
69 | 84 | name.startsWith('@img/sharp-libvips-')); |
70 | | - if (!libvips || libvips.licenseSource !== 'licenses/LGPL-3.0.txt') |
| 85 | + if (!libvips || !libvips.licenseSource.includes('licenses/LGPL-3.0.txt')) |
71 | 86 | throw new Error('Platform Sharp/libvips LGPL coverage is missing'); |
72 | 87 | if (!existsSync('.compliance/licenses/LGPL-3.0.txt')) |
73 | 88 | throw new Error('Canonical LGPL-3.0 text is missing'); |
| 89 | + const wasm = inventory.packages.find(({ name }) => name === '@img/sharp-wasm32'); |
| 90 | + if (wasm) { |
| 91 | + for (const term of ['LICENSE', 'licenses/LGPL-3.0.txt', 'canonical SPDX MIT text']) |
| 92 | + if (!wasm.licenseSource.includes(term)) |
| 93 | + throw new Error('@img/sharp-wasm32 license term ' + term + ' is unresolved'); |
| 94 | + } |
| 95 | + const native = JSON.parse(readFileSync('.compliance/NATIVE-COMPONENTS.json')); |
| 96 | + if (native.packages.length !== 1) |
| 97 | + throw new Error('Exactly one native payload must be selected'); |
| 98 | + if (!native.packages[0].name.endsWith('-' + process.arch)) |
| 99 | + throw new Error('Native payload does not match the runner architecture'); |
| 100 | + for (const excluded of native.excludedFromArtifacts) |
| 101 | + if (native.packages[0].name === excluded) |
| 102 | + throw new Error('An excluded WASM package was selected as the native payload'); |
74 | 103 | " |
75 | 104 | - name: Verify optional window provider |
76 | 105 | run: >- |
|
0 commit comments