Skip to content

Commit 85d6d3f

Browse files
committed
Add CI on Github Actions
For push and pull requests, run `swift build` and `swift test` in the following environments: - macOS-latest, Xcode 11.1 - macOS-latest, Xcode 11.2 - Ubuntu Xenial (Docker), Swift 5.1.1 - Ubuntu Xenial (Docker), Swift 5.1.2 - Ubuntu Bionic (Docker), Swift 5.1.1 - Ubuntu Bionic (Docker), Swift 5.1.2 Thanks, Microsoft <3
1 parent c28f632 commit 85d6d3f

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Continuous Integration
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
macos:
7+
name: macOS
8+
runs-on: macOS-latest
9+
strategy:
10+
matrix:
11+
xcode:
12+
- "11.1"
13+
- "11.2"
14+
action:
15+
- build
16+
- test
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Xcode version
20+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
21+
- name: Action
22+
run: swift ${{ matrix.action }}
23+
24+
ubuntu:
25+
name: Ubuntu
26+
runs-on: ubuntu-latest
27+
strategy:
28+
matrix:
29+
swift:
30+
- 5.1.1
31+
- 5.1.2
32+
ubuntu:
33+
- xenial
34+
- bionic
35+
action:
36+
- build
37+
- test
38+
steps:
39+
- uses: actions/checkout@v1
40+
- name: Action
41+
run: |
42+
dockerfile=$(mktemp)
43+
docker=swift:${{ matrix.swift }}-${{ matrix.ubuntu }}
44+
echo "FROM $docker" > $dockerfile
45+
echo 'ADD . FileCheck' >> $dockerfile
46+
echo 'WORKDIR FileCheck' >> $dockerfile
47+
echo "RUN swift ${{ matrix.action }}" >> $dockerfile
48+
image=filecheck
49+
docker image rm -f "$image" > /dev/null
50+
docker build -t "$image" -f $dockerfile .
51+
docker run --rm "$image"

0 commit comments

Comments
 (0)