-
-
Notifications
You must be signed in to change notification settings - Fork 193
94 lines (94 loc) · 3.14 KB
/
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
91
92
93
94
name: Test
on:
push:
branches:
- master
pull_request: {}
env:
swift_package_resolve: swift package resolve
swift_build: swift build --build-tests
swift_test: swift test
periphery_scan: ./.build/debug/periphery scan --quiet --skip-build
cache_version: 1
jobs:
macOS:
strategy:
fail-fast: false
matrix:
xcode: ["15.0", "14.3.1"]
include:
- xcode: "15.0"
macos: macOS-13
- xcode: "14.3.1"
macos: macOS-13
runs-on: ${{ matrix.macos }}
name: macOS
steps:
- uses: actions/checkout@master
- name: Select Xcode version
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app; swift -version
- name: Get Swift Version
id: get-swift-version
run: |
echo "::set-output name=version::$(swift -version | head -n 1 | sed s/,// )"
shell: bash
- name: Cache resolved dependencies
id: cache-resolved-dependencies
uses: actions/cache@v2
with:
path: |
.build
Package.resolved
key: ${{ runner.os }}-${{ matrix.xcode }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps-${{ hashFiles('Package.swift', 'Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ matrix.xcode }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps-
- name: Resolve dependencies
if: steps.cache-resolved-dependencies.outputs.cache-hit != 'true'
run: ${{ env.swift_package_resolve }}
- name: Build
run: ${{ env.swift_build }}
- name: Test
run: ${{ env.swift_test }}
- name: Scan
run: ${{ env.periphery_scan }} --strict
linux:
strategy:
fail-fast: false
matrix:
swift: ["5.9", "5.8"]
include:
- swift: "5.9"
container: "swiftlang/swift:nightly-5.9-jammy"
cache-version: 1
- swift: "5.8"
container: "swift:5.8"
cache-version: 1
runs-on: ubuntu-20.04
container: ${{ matrix.container }}
name: Linux
steps:
- name: Get Swift Version
id: get-swift-version
run: |
echo "::set-output name=version::$(swift -version | head -n 1 | sed s/,// )"
shell: bash
- uses: actions/checkout@master
- name: Cache resolved dependencies
id: cache-resolved-dependencies
uses: actions/cache@v2
with:
path: |
.build
Package.resolved
key: ${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps-${{ hashFiles('Package.swift', 'Package.resolved') }}
restore-keys: |
${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps-
- name: Resolve dependencies
if: steps.cache-resolved-dependencies.outputs.cache-hit != 'true'
run: ${{ env.swift_package_resolve }}
- name: Build
run: ${{ env.swift_build }}
- name: Test
run: ${{ env.swift_test }}
- name: Scan
run: ${{ env.periphery_scan }} --config .periphery.linux.yml