enable MemberImportVisibility
upcoming feature
#187
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: 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: | |
- name: swift:5.10-noble | |
continue-on-error: false | |
code_cov_args: "" | |
- name: swift:6.0-noble | |
continue-on-error: false | |
code_cov_args: "--enable-code-coverage" | |
- name: swift:6.1-noble | |
continue-on-error: false | |
# Some kind of issue with code coverage on 6.1 | |
code_cov_args: "" | |
- name: swiftlang/swift:nightly-main-jammy | |
# https://github.com/swiftlang/swift/issues/77242 | |
continue-on-error: true | |
code_cov_args: "--enable-code-coverage" | |
config: | |
- mode: "debug" | |
- mode: "release" | |
runs-on: ubuntu-latest | |
container: ${{ matrix.swift-image.name }} | |
timeout-minutes: 30 | |
steps: | |
- name: Check out ${{ github.event.repository.name }} | |
uses: actions/checkout@v4 | |
- name: Install zstd | |
run: | | |
apt-get update -y | |
apt-get install -y zstd | |
- name: Restore .build | |
if: ${{ runner.debug != '1' }} | |
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 }}-${{ matrix.config.mode }}-build-${{ matrix.swift-image.name }}-${{ runner.os }}-${{ hashFiles('./Package.resolved') }}" | |
restore-keys: "${{ github.event.repository.name }}-${{ matrix.config.mode }}-build-${{ matrix.swift-image.name }}-${{ runner.os }}-" | |
- name: Build ${{ github.event.repository.name }} | |
continue-on-error: ${{ matrix.swift-image.continue-on-error }} | |
run: swift build --build-tests -Xswiftc -enable-testing -c ${{ matrix.config.mode }} ${{ matrix.swift-image.code_cov_args }} | |
- name: Cache .build | |
if: steps.restore-cache.outputs.cache-hit != 'true' | |
uses: actions/cache/save@v4 | |
with: | |
path: .build | |
key: "${{ github.event.repository.name }}-${{ matrix.config.mode }}-build-${{ matrix.swift-image.name }}-${{ runner.os }}-${{ hashFiles('./Package.resolved') }}" | |
- name: Run tests | |
continue-on-error: ${{ matrix.swift-image.continue-on-error }} | |
run: swift test --skip-build --parallel -c ${{ matrix.config.mode }} ${{ matrix.swift-image.code_cov_args }} | |
- name: Submit code coverage | |
continue-on-error: ${{ matrix.swift-image.continue-on-error }} | |
if: ${{ matrix.swift-image.code_cov_args != '' }} | |
uses: vapor/[email protected] | |
with: | |
build_parameters: "-c ${{ matrix.config.mode }}" | |
codecov_token: "${{ secrets.CODECOV_TOKEN }}" |