-
Notifications
You must be signed in to change notification settings - Fork 3
85 lines (81 loc) · 2.26 KB
/
unit-tests.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Swift Unit Tests
on:
pull_request:
branches:
- main
- develop
push:
branches:
- main
- develop
tags:
- '*' # Push events to every tag
jobs:
swift_tests_latest:
name: Latest Swift
runs-on: macos-15
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "16.0"
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: .build
key: macos-latest-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
macos-latest-spm-
- name: Build
run: swift build
- name: Run tests
run: swift test
swift_tests_previous:
name: Swift 5.10
runs-on: macos-14
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "15.0"
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: .build
key: macos-14-swift-510-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
macos-14-swift-510-spm-
- name: Build
run: swift build
- name: Run tests
run: swift test
swift_tests_legacy:
name: Swift ${{ matrix.swift }}
strategy:
matrix:
os: [macos-13]
swift: ["5.9", "5.8"]
runs-on: ${{ matrix.os }}
steps:
- uses: swift-actions/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "14.3.1"
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: .build
key: ${{ matrix.os }}-${{ matrix.swift }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ matrix.os }}-spm-
- name: Build
run: swift build
- name: Run tests
run: swift test