-
Notifications
You must be signed in to change notification settings - Fork 1
180 lines (153 loc) · 6.49 KB
/
ci.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
name: Continuous Integration
on:
push:
branches: [ main ]
pull_request_target:
branches:
- '*'
schedule:
- cron: '0 0,12 * * *'
jobs:
ci-linux:
runs-on: ubuntu-latest
timeout-minutes: 90
env:
FAIRHUB_API_SKIP: true # used by tests to determine load
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Get swift version
run: swift --version
- name: Checkout
uses: actions/checkout@v3
- name: Run fairtool
run: |
swift run fairtool version
- name: Fair Test Linux (Debug)
run: swift test -v --configuration debug --parallel
- name: Fair Test Linux (Release)
run: swift test -v --configuration release -Xswiftc -enable-testing --parallel
- name: Check fairtool formula
if: false
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install fair-ground/tool/fairtool-head
brew test fairtool-head
fairtool-head version
ci-macOS:
runs-on: macos-12
timeout-minutes: 90
env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FAIRHUB_API_SKIP: true # used by tests to determine load
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Test iOS (Debug)
run: xcodebuild test -configuration Debug -scheme "Fair-Package" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 14 Pro"
- name: Test iOS (Release)
run: xcodebuild test -configuration Release -scheme "Fair-Package" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 14 Pro"
- name: Test macOS (Debug)
run: xcodebuild test -configuration Debug -scheme "Fair-Package" -sdk "macosx" -destination "platform=macosx"
- name: Test macOS (Release)
run: xcodebuild test -configuration Release -scheme "Fair-Package" -sdk "macosx" -destination "platform=macosx"
- name: Test Package
run: xcrun swift test --parallel
- name: Run fairtool
run: xcrun swift run fairtool version
- name: Check fairtool formula
run: |
export HOMEBREW_NO_INSTALL_CLEANUP=1
brew install fair-ground/tool/fairtool-head
brew test fairtool-head
fairtool-head version
#fairtool-head app fork App-Name
#fairtool-head app config App-Name
#fairtool-head app release App-Name
#fairtool-head app integrate App-Name
api-doc:
runs-on: macos-12
timeout-minutes: 20
env:
DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer
steps:
- uses: actions/checkout@v3
- name: Build documentation
run: |
swift -version
export SWIFTPM_ENABLE_COMMAND_PLUGINS=1
export DOCC_JSON_PRETTYPRINT="YES"
# add in the docc plugin to generate the docs
sed -I "" 's;^ *dependencies: \[ *$;dependencies: \[ .package(name: "swift-docc-plugin", url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),;g' Package.swift
# until https://github.com/apple/swift-docc/issues/255
# is implemented, we can only have a single target,
# so we copy all the FairCore files into FairApp
# cp -v Sources/FairCore/*.swift Sources/FairApp
# FairApp
swift package --allow-writing-to-directory docs \
generate-documentation --target FairApp \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path Fair \
--output-path docs
# FairCore
swift package --allow-writing-to-directory docs-faircore \
generate-documentation --target FairCore \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path Fair \
--output-path docs-faircore
cp -R "docs-faircore/data/documentation/"* "docs/data/documentation/"
cp -R "docs-faircore/documentation/"* "docs/documentation/"
rm -r docs-faircore
# FairKit
swift package --allow-writing-to-directory docs-fairkit \
generate-documentation --target FairKit \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path Fair \
--output-path docs-fairkit
cp -R "docs-fairkit/data/documentation/"* "docs/data/documentation/"
cp -R "docs-fairkit/documentation/"* "docs/documentation/"
rm -r docs-fairkit
# FairExpo
swift package --allow-writing-to-directory docs-fairexpo \
generate-documentation --target FairExpo \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path Fair \
--output-path docs-fairexpo
cp -R "docs-fairexpo/data/documentation/"* "docs/data/documentation/"
cp -R "docs-fairexpo/documentation/"* "docs/documentation/"
rm -r docs-fairexpo
# FairTool executable
swift package --allow-writing-to-directory docs-fairtool \
generate-documentation --target fairtool \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path Fair \
--output-path docs-fairtool
cp -R "docs-fairtool/data/documentation/"* "docs/data/documentation/"
cp -R "docs-fairtool/documentation/"* "docs/documentation/"
rm -r docs-fairtool
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: '.'