.github/workflows/checks.yml #401
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
paths: | |
- src/*.ts | |
- fixtures/**/*.swift | |
- .github/workflows/checks.yml | |
- dist/* | |
schedule: | |
- cron: '3 3 * * 5' # 3:03 AM, every Friday | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.head_ref || 'cron' }} | |
cancel-in-progress: true | |
jobs: | |
verify-dist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: npm i | |
- run: npm run prepare | |
- run: git diff --exit-code | |
defaults: | |
runs-on: macos-latest | |
needs: [verify-dist] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
working-directory: fixtures/debug | |
xcodebuild-has-exited: | |
runs-on: macos-latest | |
needs: [verify-dist] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
working-directory: fixtures/debug | |
- run: | | |
if pgrep -a xcodebuild; then | |
echo >&2 "error: xcodebuild is still running" | |
exit 1 | |
fi | |
executable-runs: | |
runs-on: macos-latest | |
needs: [verify-dist] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
action: build | |
working-directory: fixtures/executable | |
- run: | | |
OUT=$(~/Library/Developer/Xcode/DerivedData/executable-*/Build/Products/Debug/my-fixture) | |
if [[ "${OUT}" != 'Hello, world!' ]]; then | |
echo >&2 "error: output of my-fixture was unexpected: ${OUT}" | |
exit 1 | |
fi | |
invalid-action-fails: | |
runs-on: macos-latest | |
needs: [verify-dist] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
id: xcodebuild | |
with: | |
action: invalid | |
working-directory: fixtures/debug | |
continue-on-error: true | |
- if: steps.xcodebuild.outcome == 'success' | |
run: | | |
echo >&2 "error: expected action to fail, but it succeeded" | |
exit 1 | |
invalid-platform-fails: | |
runs-on: macos-latest | |
needs: [verify-dist] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
id: xcodebuild | |
with: | |
platform: invalid | |
working-directory: fixtures/debug | |
continue-on-error: true | |
- if: steps.xcodebuild.outcome == 'success' | |
run: | | |
echo >&2 "error: expected action to fail, but it succeeded" | |
exit 1 | |
invalid-swift-fails: | |
runs-on: macos-latest | |
needs: [verify-dist] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
id: xcodebuild | |
with: | |
swift: invalid | |
working-directory: fixtures/debug | |
continue-on-error: true | |
- if: steps.xcodebuild.outcome == 'success' | |
run: | | |
echo >&2 "error: expected action to fail, but it succeeded" | |
exit 1 | |
invalid-xcode-fails: | |
runs-on: macos-latest | |
needs: [verify-dist] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
id: xcodebuild | |
with: | |
xcode: invalid | |
working-directory: fixtures/debug | |
continue-on-error: true | |
- if: steps.xcodebuild.outcome == 'success' | |
run: | | |
echo >&2 "error: expected action to fail, but it succeeded" | |
exit 1 | |
missing-api-key-id-fails: | |
runs-on: macos-latest | |
needs: [verify-dist] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
id: xcodebuild | |
with: | |
authentication-key-base64: 'Cg==' | |
authentication-key-issuer-id: '14sb3dw0-r3t1-83u1-g381-4k9sg1t3w8r2' | |
working-directory: fixtures/debug | |
continue-on-error: true | |
- if: steps.xcodebuild.outcome == 'success' | |
run: | | |
echo >&2 "error: expected action to fail, but it succeeded" | |
exit 1 | |
missing-api-key-issuer-id-fails: | |
runs-on: macos-latest | |
needs: [verify-dist] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
id: xcodebuild | |
with: | |
authentication-key-base64: 'Cg==' | |
authentication-key-id: 'JW271KX2u3' | |
working-directory: fixtures/debug | |
continue-on-error: true | |
- if: steps.xcodebuild.outcome == 'success' | |
run: | | |
echo >&2 "error: expected action to fail, but it succeeded" | |
exit 1 | |
null-none-action: | |
runs-on: macos-latest | |
needs: [verify-dist] | |
strategy: | |
matrix: | |
action: | |
- null # treated as '' by GHA’s parser | |
- ~ # treated as '' by GHA’s parser | |
- '' | |
- none | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
working-directory: fixtures/debug | |
action: ${{ matrix.action }} | |
configurations: | |
runs-on: macos-12 | |
needs: [verify-dist] | |
strategy: | |
matrix: | |
configuration: | |
- debug | |
- release | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
configuration: ${{ matrix.configuration }} | |
working-directory: fixtures/${{ matrix.configuration }} | |
warnings-as-errors: true | |
action: test | |
upload-logs: always # so we can test this feature | |
verbosity: | |
runs-on: macos-latest | |
needs: [verify-dist] | |
strategy: | |
matrix: | |
verbosity: | |
- xcpretty | |
- quiet | |
- verbose | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
verbosity: ${{ matrix.verbosity }} | |
working-directory: fixtures/debug | |
swift: | |
name: swift ${{ matrix.x.swift }} | |
runs-on: ${{ matrix.x.os }} | |
needs: [verify-dist] | |
strategy: | |
matrix: | |
x: | |
- swift: ~5.5 | |
os: macos-12 | |
- swift: ~5.6 | |
os: macos-12 | |
- swift: ~5.7 | |
os: macos-13 | |
- swift: ~5.8 | |
os: macos-14 | |
- swift: ~5.9 | |
os: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
swift: ${{ matrix.x.swift }} | |
working-directory: fixtures/swift/${{ matrix.x.swift }} | |
action: build | |
- uses: mxcl/get-swift-version@v2 | |
with: | |
requires: ${{ matrix.x.swift }} | |
xcode: | |
name: ${{ matrix.platform }} (${{ matrix.action }}, ${{ matrix.xcode }}${{ matrix.codecov && ', cc' || ''}}${{ matrix.job-name-sufix }}) | |
runs-on: ${{ matrix.os || 'macos-12' }} | |
needs: [verify-dist] | |
strategy: | |
matrix: | |
platform: | |
- iOS | |
- tvOS | |
- macOS | |
- watchOS | |
xcode: | |
- ^13 | |
- ^14 | |
codecov: | |
- false | |
action: | |
- test | |
warnings-as-errors: | |
- false | |
include: | |
- job-name-sufix: ', platform-version ^16' | |
platform: iOS | |
platform-version: ^16 | |
os: macos-14 | |
xcode: ^14 | |
- platform: mac-catalyst | |
xcode: ^13 | |
codecov: false | |
action: test | |
warnings-as-errors: false | |
- platform: visionOS | |
os: macos-14 | |
xcode: ^15 | |
codecov: false | |
action: test | |
warnings-as-errors: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
platform: ${{ matrix.platform }} | |
platform-version: ${{ matrix.platform-version }} | |
xcode: ${{ matrix.xcode }} | |
working-directory: fixtures/${{ matrix.platform }} | |
code-coverage: ${{ matrix.codecov }} | |
action: ${{ matrix.action }} | |
warnings-as-errors: ${{ matrix.warnings-as-errors }} | |
- run: | | |
xcode-select --print-path | |
# lol we didn't comment on how this was different to the above and now I'm not sure | |
more-xcode: | |
name: ${{ matrix.platform }} (${{ matrix.action }}, ${{ matrix.xcode }}${{ matrix.codecov && ', cc' || ''}}, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
needs: [verify-dist] | |
strategy: | |
matrix: | |
os: | |
- macos-12 | |
platform: | |
- watchOS | |
xcode: | |
- ^13 | |
codecov: | |
- false | |
action: | |
- build | |
- test | |
warnings-as-errors: | |
- false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
platform: ${{ matrix.platform }} | |
xcode: ${{ matrix.xcode }} | |
working-directory: fixtures/${{ matrix.platform }} | |
code-coverage: ${{ matrix.codecov }} | |
action: ${{ matrix.action }} | |
warnings-as-errors: ${{ matrix.warnings-as-errors }} | |
verify-codecov: | |
name: ${{ matrix.platform }} (${{ matrix.action }}${{ matrix.codecov && ', cc' || ''}}${{ matrix.warnings-as-errors && ', warnings-as-errors' || ''}}) | |
runs-on: macos-12 | |
needs: [verify-dist] | |
strategy: | |
matrix: | |
platform: | |
- macOS | |
codecov: | |
- true | |
- false | |
action: | |
- build | |
- test | |
warnings-as-errors: | |
- true | |
- false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
platform: ${{ matrix.platform }} | |
working-directory: fixtures/${{ matrix.platform }} | |
code-coverage: ${{ matrix.codecov }} | |
action: ${{ matrix.action }} | |
warnings-as-errors: ${{ matrix.warnings-as-errors }} | |
verify-dot-swift-version: | |
name: .swift-version | |
runs-on: macos-14 | |
needs: [verify-dist] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mxcl/get-swift-version@v2 | |
with: | |
requires: '>5.8' | |
- uses: ./ | |
with: | |
working-directory: fixtures/dot-swift-version | |
- uses: mxcl/get-swift-version@v2 | |
with: | |
requires: ~5.9 |