Skip to content

Commit 6bedbd5

Browse files
committed
Add GitHub actions
1 parent 7375bc7 commit 6bedbd5

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- '*'
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
library:
18+
name: macOS
19+
strategy:
20+
matrix:
21+
xcode: ['16.3']
22+
config: ['debug', 'release']
23+
runs-on: macos-15
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Select Xcode ${{ matrix.xcode }}
27+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
28+
- name: Run ${{ matrix.config }} tests
29+
run: swift test -c ${{ matrix.config }}
30+
31+
linux:
32+
name: Linux
33+
strategy:
34+
matrix:
35+
swift:
36+
- '6.1'
37+
runs-on: ubuntu-latest
38+
container: swift:${{ matrix.swift }}
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Build
42+
run: swift build
43+
44+
check-macro-compatibility:
45+
name: Check Macro Compatibility
46+
runs-on: macos-latest
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v4
50+
- name: Run Swift Macro Compatibility Check
51+
uses: Matejkob/swift-macro-compatibility-check@v1
52+
with:
53+
run-tests: false
54+
major-versions-only: true

.github/workflows/format.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
NB: Compatible swift-format requires Xcode 16.3, not yet available on GitHub
2+
name: Format
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: format-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
swift_format:
15+
name: swift-format
16+
runs-on: macos-15
17+
permissions:
18+
contents: write
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Select Xcode 16.3
22+
run: sudo xcode-select -s /Applications/Xcode_16.3.app
23+
- name: Format
24+
run: make format
25+
- uses: stefanzweifel/git-auto-commit-action@v5
26+
with:
27+
commit_message: Run swift-format
28+
branch: 'main'

0 commit comments

Comments
 (0)