Skip to content

if test check

if test check #2

name: Extra soundness

Check failure on line 1 in .github/workflows/extra_soundness.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/extra_soundness.yml

Invalid workflow file

(Line: 54, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.SSH_PRIVATE_KEY, (Line: 60, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.SSH_PRIVATE_KEY
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