82 lines
2.5 KiB
YAML
82 lines
2.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
macOS:
|
|
runs-on: macOS-latest
|
|
strategy:
|
|
matrix:
|
|
xcode: ["11.7", "12.2"]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
- name: Select Xcode ${{ matrix.xcode }}
|
|
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
|
|
- name: Swift version
|
|
run: swift --version
|
|
- name: Test
|
|
run: swift test -v --skip-update --parallel --enable-test-discovery --enable-code-coverage
|
|
env:
|
|
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
|
|
- name: Generate coverage report
|
|
run: xcrun llvm-cov export -format="lcov" .build/debug/*PackageTests.xctest/Contents/MacOS/*PackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov
|
|
- name: Upload code coverage report
|
|
uses: codecov/codecov-action@master
|
|
with:
|
|
token: ${{secrets.CODECOV_TOKEN}}
|
|
file: coverage.lcov
|
|
fail_ci_if_error: true
|
|
- name: Build Release
|
|
run: swift build -c release
|
|
env:
|
|
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
|
|
|
|
linux:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
swift: ["5.1", "latest"]
|
|
container:
|
|
image: swift:${{ matrix.swift }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
- name: "Update APT"
|
|
shell: bash
|
|
run: "apt update"
|
|
- name: "Install curl"
|
|
shell: bash
|
|
run: "apt-get install -y curl"
|
|
- name: Swift version
|
|
run: swift --version
|
|
- name: Test
|
|
run: swift test -v --skip-update --parallel --enable-test-discovery --enable-code-coverage
|
|
- name: Generate coverage report
|
|
run: llvm-cov export -format="lcov" .build/debug/*PackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > coverage.lcov
|
|
- name: Upload code coverage report
|
|
uses: codecov/codecov-action@master
|
|
with:
|
|
token: ${{secrets.CODECOV_TOKEN}}
|
|
file: coverage.lcov
|
|
fail_ci_if_error: true
|
|
- name: Build Release
|
|
run: swift build -c release
|
|
|
|
|
|
webAssembly:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
- name: Swift version
|
|
run: swift --version
|
|
- name: Build
|
|
uses: swiftwasm/swiftwasm-action@main
|
|
with:
|
|
shell-action: swift build --triple wasm32-unknown-wasi
|