-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (37 loc) · 1.1 KB
/
run_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
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
name: Swift
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
verify_formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore swiftformat build cache
uses: actions/cache@v3
with:
path: .build/release/swiftformat
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Build swiftformat
run: |
if [ ! -f ".build/release/swiftformat" ]; then
swift build --product swiftformat -c release
fi
- name: Run swiftformat
run: .build/release/swiftformat --verbose .
- name: Verify that formatted code is unchanged
run: git diff --exit-code HEAD
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: swift build
- name: Run tests
run: swift test