if test check #2
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: Extra soundness | ||
|
Check failure on line 1 in .github/workflows/extra_soundness.yml
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| local_swift_dependencies_check_enabled: | ||
| type: boolean | ||
| description: "Boolean to enable the local swift dependencies check job. Defaults to false." | ||
| default: false | ||
| run_tests_with_cache_enabled: | ||
| type: boolean | ||
| description: "Boolean to enable run tests with .build cache." | ||
| default: false | ||
| run_tests_swift_versions: | ||
| type: string | ||
| description: "List of Swift versions to test with." | ||
| default: '["6.0", "6.1"]' | ||
| secrets: | ||
| SSH_PRIVATE_KEY: | ||
| required: false | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }}-extra-soundness | ||
| cancel-in-progress: true | ||
| jobs: | ||
| local_swift_dependencies_check: | ||
| name: Local swift dependencies check | ||
| if: ${{ inputs.local_swift_dependencies_check_enabled }} | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 1 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Run local swift dependencies check | ||
| run: curl -s https://raw.githubusercontent.com/BinaryBirds/github-workflows/refs/heads/main/scripts/check-local-swift-dependencies.sh | bash | ||
| cache-and-test: | ||
| name: Run tests with cache | ||
| if: ${{ inputs.run_tests_with_cache_enabled }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| swift: ${{ fromJson(inputs.run_tests_swift_versions) }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Set up SSH if key provided | ||
| if: ${{ secrets.SSH_PRIVATE_KEY }} | ||
| uses: webfactory/ssh-agent@v0.9.0 | ||
| with: | ||
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
| - name: Trust github.com | ||
| if: ${{ secrets.SSH_PRIVATE_KEY }} | ||
| run: | | ||
| mkdir -p ~/.ssh | ||
| ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
| - name: Install zstd | ||
| run: | | ||
| sudo apt-get update -y | ||
| sudo apt-get install -y zstd | ||
| - name: Restore .build | ||
| id: "restore-build" | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: .build | ||
| key: "swiftpm-tests-build-${{ runner.os }}-${{ matrix.swift }}-${{ github.event.pull_request.base.sha || github.event.after }}" | ||
| restore-keys: "swiftpm-tests-build-${{ runner.os }}-${{ matrix.swift }}-" | ||
| - name: Build package | ||
| run: swift build --build-tests | ||
| - name: Cache .build | ||
| if: steps.restore-build.outputs.cache-hit != 'true' | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: .build | ||
| key: "swiftpm-tests-build-${{ runner.os }}-${{ matrix.swift }}-${{ github.event.pull_request.base.sha || github.event.after }}" | ||
| - name: Run unit tests | ||
| run: swift test --skip-build --parallel | ||