feat(batch): pre-fetch file versions for cache-enabled batch runs #42
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
| name: CI | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup mise environment | |
| run: source Scripts/environment.sh | |
| shell: bash | |
| - name: Check formatting (SwiftFormat) | |
| run: bin/mise run format-check | |
| - name: Check markdown formatting (mdformat) | |
| run: bin/mise run format-md-check | |
| - name: Lint (SwiftLint) | |
| run: bin/mise run lint | |
| build-macos: | |
| name: Build & Test (macOS) | |
| runs-on: macos-15 | |
| needs: lint | |
| env: | |
| DEVELOPER_DIR: "/Applications/Xcode_16.3.app/Contents/Developer" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Cache SPM dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: .build | |
| key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-spm- | |
| - name: Setup mise environment | |
| run: source Scripts/environment.sh | |
| shell: bash | |
| - name: Show Swift version | |
| run: swift --version | |
| - name: Build | |
| run: swift build 2>&1 | xcsift | |
| - name: Test | |
| run: swift test --enable-code-coverage 2>&1 | xcsift | |
| - name: Generate coverage report | |
| if: github.ref == 'refs/heads/main' | |
| continue-on-error: true | |
| run: ./Scripts/coverage.sh | |
| build-linux: | |
| name: Build & Test (Linux) | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| container: | |
| image: swift:6.0 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Show Swift version | |
| run: swift --version | |
| - name: Build | |
| run: swift build | |
| - name: Run tests | |
| # Use --num-workers 1 to avoid memory corruption with libpng on Linux | |
| run: swift test --parallel --num-workers 1 |