feat: add GitHub CLI shell helper #34
This file contains hidden or 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
| # Workflow: per-target tests for CommonShellTests | |
| name: "⚠️ | Test | CommonShellTests" | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| branches: [ main ] | |
| tags: [ 'v*.*.*' ] | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| container: swift:6.1-noble | |
| steps: | |
| - name: Checkout (with submodules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install zstd (cache compression) | |
| run: | | |
| apt-get update -y | |
| apt-get install -y zstd | |
| - name: Restore .build cache | |
| id: restore-build | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: .build | |
| key: swiftpm-build-${{ runner.os }}-${{ hashFiles('**/Package.resolved', '**/Package.swift') }} | |
| restore-keys: | | |
| swiftpm-build-${{ runner.os }}- | |
| - name: Build tests | |
| run: swift build --build-tests --enable-code-coverage | |
| - name: Cache .build (if miss) | |
| if: steps.restore-build.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: .build | |
| key: swiftpm-build-${{ runner.os }}-${{ hashFiles('**/Package.resolved', '**/Package.swift') }} | |
| - name: Run CommonShellTests | |
| run: swift test --skip-build --enable-code-coverage --parallel --filter '^CommonShellTests\.' |