generated from Apodini/Template-Repository
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (88 loc) · 2.75 KB
/
build-and-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Build and Test
on:
push:
branches:
- develop
- release
pull_request:
branches:
- develop
- release
workflow_dispatch:
jobs:
latest-beta-swift-version:
name: Latest (Beta) Swift Version
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/[email protected]
with:
xcode-version: latest
- uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
- name: Check Xcode version
run: xcodebuild -version
- name: Check Swift version
run: swift --version
- name: Debug Build & Test
run: swift test
macos:
name: macOS ${{ matrix.configuration }}
runs-on: macos-11
strategy:
fail-fast: false
matrix:
configuration: [debug, release, release_testing]
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
- uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
- name: Check Xcode version
run: xcodebuild -version
- name: Check Swift version
run: swift --version
- name: Release Build
if: matrix.configuration == 'release'
run: swift build -c release
- name: Release Build & Test
if: matrix.configuration == 'release_testing'
run: swift test -c release -Xswiftc -enable-testing -Xswiftc -DRELEASE_TESTING
- name: Debug Build & Test
if: matrix.configuration == 'debug'
run: swift test -c debug --enable-code-coverage -Xswiftc -DCOVERAGE
- name: Convert coverage report
if: matrix.configuration == 'debug'
run: xcrun llvm-cov export -format="lcov" .build/debug/AnalystPackageTests.xctest/Contents/MacOS/AnalystPackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
linux:
name: Linux ${{ matrix.linux }} ${{ matrix.configuration }}
container:
image: swift:${{ matrix.linux }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
linux: [bionic, xenial, focal, amazonlinux2, centos8]
configuration: [debug, release]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-${{matrix.linux}}-spm-${{ hashFiles('Package.resolved') }}
- name: Check Swift version
run: swift --version
- name: Release Build
if: matrix.configuration == 'release'
run: swift build -c release
- name: Debug Build & Test
if: matrix.configuration == 'debug'
run: swift test -c debug