-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (116 loc) · 5 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
name: GGViz CI
on:
push:
branches: [ main ]
pull_request:
branches:
- '*'
schedule:
# run at 11AM & 11PM UTC
- cron: '0 11,23 * * *'
jobs:
Linux:
if: false # build is crashing
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libjavascriptcoregtk-4.0-dev
- uses: actions/checkout@v2
- name: Test (Debug)
run: swift test -v --configuration debug
- name: Test (Release)
run: swift test -v --configuration release -Xswiftc -enable-testing
iOS:
runs-on: macos-11
env:
DEVELOPER_DIR: /Applications/Xcode_12.5.app/Contents/Developer
steps:
- uses: actions/checkout@v2
- name: Remove Tool from Package.swift (SR-1954)
run: sed -i'.bk' 's;\(.*\)// SR-1954$;// SR-1954 \1;g' Package.swift
- run: |
xcodebuild clean test \
-disablePackageRepositoryCache \
-configuration Release \
-scheme "GGViz-Package" \
-sdk "iphonesimulator" \
-destination "platform=iOS Simulator,name=iPod touch (7th generation)" \
ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
tvOS:
runs-on: macos-11
needs: [iOS] # iOS must pass first
env:
DEVELOPER_DIR: /Applications/Xcode_12.5.app/Contents/Developer
steps:
- uses: actions/checkout@v2
- name: Remove Tool from Package.swift (SR-1954)
run: sed -i'.bk' 's;\(.*\)// SR-1954$;// SR-1954 \1;g' Package.swift
- run: |
xcodebuild clean test \
-disablePackageRepositoryCache \
-configuration Release \
-scheme "GGViz-Package" \
-sdk "appletvsimulator" \
-destination "platform=tvOS Simulator,name=Apple TV" \
ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
macOS11:
runs-on: macos-11
# needs: [Linux] # Linux must pass first
env:
DEVELOPER_DIR: /Applications/Xcode_12.5.app/Contents/Developer
steps:
- uses: actions/checkout@v2
- name: Test (Debug)
run: swift test --configuration debug
- name: Test (Release)
run: swift test --configuration release -Xswiftc -enable-testing
Windows10:
if: false # JavaScriptCore not available on Windows
# needs: [Linux] # Linux must pass first
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install JavaScriptCore.dll
run: |
Install-Binary -Url "https://secure-appldnld.apple.com/itunes12/001-97787-20210421-F0E5A3C2-A2C9-11EB-A40B-A128318AD179/iTunes64Setup.exe" -Name "iTunes64Setup.exe" -ArgumentList ("-q")
- uses: seanmiddleditch/gha-setup-vsdevenv@master
- name: Install Install swift-5.4.1-RELEASE
run: |
Install-Binary -Url "https://swift.org/builds/swift-5.4.1-release/windows10/swift-5.4.1-RELEASE/swift-5.4.1-RELEASE-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
- name: Set Environment Variables
run: |
echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "DEVELOPER_DIR=C:\Library\Developer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Adjust Paths
run: |
echo "C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Supporting Files
run: |
Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap"
Copy-Item "$env:SDKROOT\usr\share\visualc.modulemap" -destination "$env:VCToolsInstallDir\include\module.modulemap"
Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes"
Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap"
- name: Swift Version
run: swift --version
- name: Build (Debug)
run: swift build -v -c debug
- name: Build (Release)
run: swift build -v -c release
- name: Test (Debug)
run: swift test -v --configuration debug --enable-test-discovery
- name: Test (Release)
run: swift test -v --configuration release -Xswiftc -enable-testing --enable-test-discovery
Release:
runs-on: ubuntu-latest
needs: [macOS11, iOS, tvOS]
steps:
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
CHANGELOG.md
RELEASE_NOTES.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}