Skip to content

Commit 694b9c7

Browse files
authored
chore(ci): Add workflow for build and test (#18)
1 parent 34d6aa8 commit 694b9c7

File tree

4 files changed

+87
-3
lines changed

4 files changed

+87
-3
lines changed

.github/workflows/build-test.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Build and Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
name: Build
18+
runs-on: macos-15
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v4
22+
23+
- name: Install Dependencies
24+
run: brew bundle --file Brewfile-ci
25+
26+
- name: Build
27+
run: make build-ios
28+
29+
- name: Upload Logs
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: build-logs
33+
path: |
34+
raw-build-ios.log
35+
retention-days: 1
36+
37+
build-test:
38+
name: Test
39+
runs-on: macos-15
40+
steps:
41+
- name: Checkout Code
42+
uses: actions/checkout@v4
43+
44+
- name: Install Dependencies
45+
run: brew bundle --file Brewfile-ci
46+
47+
- name: Test
48+
run: make test-ios
49+
50+
- name: Upload Logs
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: test-logs
54+
path: |
55+
raw-test-ios.log
56+
retention-days: 1
57+
58+
build-test-ui:
59+
name: Test UI
60+
runs-on: macos-15
61+
steps:
62+
- name: Checkout Code
63+
uses: actions/checkout@v4
64+
65+
- name: Install Dependencies
66+
run: brew bundle --file Brewfile-ci
67+
68+
- name: Test UI
69+
run: make test-ui-ios
70+
71+
- name: Upload Logs
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: ui-test-logs
75+
path: |
76+
raw-test-ui-ios.log
77+
retention-days: 1

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ Generated/
102102
.sentryclirc
103103
.env
104104

105+
# Build logs
106+
raw-build-ios.log
107+
raw-test-ios.log
108+
raw-test-ui-ios.log
109+
105110
# --- Ruby ---
106111

107112
vendor

Brewfile-ci

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
brew "licenseplist"
2+
brew "swiftgen"

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
.PHONY: build-ios test-ios format lint generate generate-licenses generate-localization generate-app-store-summary generate-app-icons generate-screenshots publish-beta-build
22

33
build-ios:
4-
xcrun xcodebuild -project Flinky.xcodeproj -scheme Flinky -destination 'platform=iOS Simulator,name=iPhone 16 Pro' build | xcbeautify
4+
set -o pipefail && NSUnbufferedIO=YES xcrun xcodebuild -project Flinky.xcodeproj -scheme Flinky -destination 'platform=iOS Simulator,name=iPhone 16 Pro' build | tee raw-build-ios.log | xcbeautify
55

66
test-ios:
7-
xcrun xcodebuild -project Flinky.xcodeproj -scheme Flinky -destination 'platform=iOS Simulator,name=iPhone 16 Pro' test | xcbeautify
7+
set -o pipefail && NSUnbufferedIO=YES xcrun xcodebuild -project Flinky.xcodeproj -scheme Flinky -destination 'platform=iOS Simulator,name=iPhone 16 Pro' test | tee raw-test-ios.log | xcbeautify
88

99
test-ui-ios:
10-
xcrun xcodebuild -project Flinky.xcodeproj -scheme ScreenshotUITests -destination 'platform=iOS Simulator,name=iPhone 16 Pro' test | xcbeautify
10+
set -o pipefail && NSUnbufferedIO=YES xcrun xcodebuild -project Flinky.xcodeproj -scheme ScreenshotUITests -destination 'platform=iOS Simulator,name=iPhone 16 Pro' test | tee raw-test-ui-ios.log | xcbeautify
1111

1212
format: format-swift format-json format-markdown format-yaml
1313

0 commit comments

Comments
 (0)