Skip to content

Commit 6717df8

Browse files
authored
Merge pull request #17 from NeedleInAJayStack/fix/swiftformat
chore: Adjusts format CI to use docker
2 parents 3a6748e + 696198d commit 6717df8

File tree

2 files changed

+36
-18
lines changed

2 files changed

+36
-18
lines changed

.github/workflows/test.yml

+34-17
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
name: Format linting
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
- uses: sinoru/actions-setup-swift@v2
15-
with:
16-
swift-version: '5.6.1'
17-
- name: GitHub Action for SwiftFormat
18-
uses: CassiusPacheco/action-swiftformat@v0.1.0
19-
with:
20-
swiftformat-version: '0.49.17'
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v2
17+
- name: Pull formatting docker image
18+
run: docker pull ghcr.io/nicklockwood/swiftformat:latest
19+
- name: Run format linting
20+
run: docker run --rm -v ${{ github.workspace }}:/repo ghcr.io/nicklockwood/swiftformat:latest /repo --lint
2121
macos-build:
2222
name: Build and test on ${{ matrix.os }}
2323
runs-on: ${{ matrix.os }}
@@ -33,18 +33,35 @@ jobs:
3333
run: swift build
3434
- name: Run tests
3535
run: swift test
36-
linux-build:
37-
name: Build and test ${{ matrix.swift }} on ${{ matrix.os }}
36+
37+
# ubuntu-latest is ubuntu-22.04 currently. Swift versions older than 5.7 don't have builds for 22.04. https://www.swift.org/download/
38+
ubuntu-old:
39+
name: Build ${{ matrix.swift }} on ${{ matrix.os }}
3840
runs-on: ${{ matrix.os }}
3941
strategy:
4042
matrix:
41-
os: [ubuntu-latest]
43+
os: [ubuntu-20.04]
4244
swift: ["5.4", "5.5", "5.6"]
4345
steps:
44-
- uses: swift-actions/setup-swift@v1
45-
with:
46-
swift-version: ${{ matrix.swift }}
47-
- uses: actions/checkout@v2
48-
- name: Test
49-
run: swift test
46+
- uses: swift-actions/setup-swift@v1
47+
with:
48+
swift-version: ${{ matrix.swift }}
49+
- uses: actions/checkout@v3
50+
- name: Test
51+
run: swift test
52+
53+
ubuntu-latest:
54+
name: Build ${{ matrix.swift }} on ${{ matrix.os }}
55+
runs-on: ${{ matrix.os }}
56+
strategy:
57+
matrix:
58+
os: [ubuntu-latest]
59+
swift: ["5.7"]
60+
steps:
61+
- uses: swift-actions/setup-swift@v1
62+
with:
63+
swift-version: ${{ matrix.swift }}
64+
- uses: actions/checkout@v3
65+
- name: Test
66+
run: swift test
5067

Tests/DataLoaderTests/DataLoaderAsyncTests.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ import XCTest
9696
async let value1 = identityLoader.load(key: 1, on: eventLoopGroup)
9797
async let value2 = identityLoader.load(key: 2, on: eventLoopGroup)
9898

99-
/// Have to wait for a split second because Tasks may not be executed before this statement
99+
/// Have to wait for a split second because Tasks may not be executed before this
100+
/// statement
100101
try await Task.sleep(nanoseconds: 500_000_000)
101102

102103
XCTAssertNoThrow(try identityLoader.execute())

0 commit comments

Comments
 (0)