-
Notifications
You must be signed in to change notification settings - Fork 67
86 lines (80 loc) · 2.41 KB
/
build.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
name: Tests
on:
push:
branches: [ main ]
paths-ignore: [ README.md ]
pull_request:
branches: [ main ]
paths-ignore: [ README.md ]
workflow_dispatch:
jobs:
formatlint:
name: Format linting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Pull formatting docker image
run: docker pull ghcr.io/nicklockwood/swiftformat:latest
- name: Run format linting
run: docker run --rm -v ${{ github.workspace }}:/repo ghcr.io/nicklockwood/swiftformat:latest /repo --lint
macos:
name: Test on macOS
runs-on: macOS-latest
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- uses: actions/checkout@v3
- name: Build and test
run: swift test --parallel --enable-test-discovery
linux:
name: Test on Linux
runs-on: ubuntu-latest
steps:
- uses: swift-actions/setup-swift@v1
- uses: actions/checkout@v3
- name: Test
run: swift test --parallel --enable-code-coverage
- name: Get test coverage html
run: |
llvm-cov show \
$(swift build --show-bin-path)/GraphitiPackageTests.xctest \
--instr-profile $(swift build --show-bin-path)/codecov/default.profdata \
--ignore-filename-regex="\.build|Tests" \
--format html \
--output-dir=.test-coverage
- name: Upload test coverage html
uses: actions/upload-artifact@v3
with:
name: test-coverage-report
path: .test-coverage
backcompat-ubuntu-22_04:
name: Test Swift ${{ matrix.swift }} on Ubuntu 22.04
runs-on: ubuntu-22.04
strategy:
matrix:
swift: ["5.7", "5.8", "5.9"]
steps:
- uses: swift-actions/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v3
- name: Test
run: swift test --parallel
# Swift versions older than 5.7 don't have builds for ubuntu 22.04. https://www.swift.org/download/
backcompat-ubuntu-20_04:
name: Test Swift ${{ matrix.swift }} on Ubuntu 20.04
runs-on: ubuntu-20.04
strategy:
matrix:
swift: ["5.4", "5.5", "5.6"]
steps:
- uses: swift-actions/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v3
- name: Test
run: swift test --parallel