-
-
Notifications
You must be signed in to change notification settings - Fork 41
64 lines (49 loc) · 1.32 KB
/
lint-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
name: Lint and Test
on:
push:
branches: [ main ] # Running on every branch causes double runs for PR commits
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
# The type of runner that the job will run on
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Xcode Select
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.1'
- name: Cache Swift Build
uses: actions/cache@v3
with:
path: .build
key: swift-build-cache
# Runs a single command using the runners shell
- name: Build
run: swift build
test:
runs-on: macos-12
needs: [build]
steps:
- uses: actions/checkout@v3
- name: Xcode Select
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.1'
- name: Cache Swift Build
uses: actions/cache@v3
with:
path: .build
key: swift-build-cache # -${{ hashFiles('**/*.swift') }}
- name: Test
run: swift test
lint:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v1
# Don't need submodules for linting
- name: SwiftLint
uses: norio-nomura/[email protected]