Skip to content

run tests in release mode as well #154

run tests in release mode as well

run tests in release mode as well #154

Workflow file for this run

name: tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request: { types: [opened, reopened, synchronize] }
push: { branches: [main] }
jobs:
tests:
strategy:
fail-fast: false
matrix:
swift-image:
- swift:5.10-noble
- swift:6.0-noble
- swiftlang/swift:nightly-main-jammy
args:
- "--enable-code-coverage --parallel"
- "-c release -Xswiftc -enable-testing --enable-code-coverage --parallel"
runs-on: ubuntu-latest
container: ${{ matrix.swift-image }}
timeout-minutes: 30
steps:
- name: Check out ${{ github.event.repository.name }}
uses: actions/checkout@v4
- name: Restore .build
id: "restore-cache"
uses: actions/cache/restore@v4
with:
path: .build
# e.g. 'enumerator-macro-debug-build-swiftlang/swift:nightly-6.0-jammy-Linux-c7008df8062ac4d5887ead9e59aa05829e'
key: "${{ github.event.repository.name }}-debug-build-${{ matrix.swift-image }}-${{ runner.os }}-${{ hashFiles('./Package.resolved') }}"
restore-keys: "${{ github.event.repository.name }}-debug-build-${{ matrix.swift-image }}-${{ runner.os }}-"
- name: Build ${{ github.event.repository.name }}
run: swift build --build-tests
- name: Cache .build
if: steps.restore-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: .build
key: "${{ github.event.repository.name }}-debug-build-${{ matrix.swift-image }}-${{ runner.os }}-${{ hashFiles('./Package.resolved') }}"
- name: Run tests
run: swift test ${{ matrix.args }}
- name: Submit code coverage
uses: vapor/swift-codecov-action@v0.3
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}