This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
185 lines (157 loc) · 6.3 KB
/
ci-tests.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
180
181
182
183
184
185
name: "ci tests"
on:
push:
paths-ignore:
- "**.md"
- "**/publish.yml"
- "**/discord.yml"
pull_request:
paths-ignore:
- "**.md"
- "**/publish.yml"
- "**/discord.yml"
env:
# Not needed in CI, should make things a bit faster
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
# Build smaller artifacts to avoid running out of space in CI
RUSTFLAGS: -C strip=debuginfo -C opt-level=s
jobs:
test-tauri:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- macos-12
- windows-2022
runs-on: ${{ matrix.os }}
steps:
- name: git checkout
uses: actions/checkout@v2
# For sloth256-189 Wasm support we need `llvm-ar`, which is not available by default
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "14.0"
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 16
- name: install Rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-08-12
target: wasm32-unknown-unknown
override: true
- name: CUDA toolchain
uses: Jimver/cuda-toolkit@v0.2.6
if: runner.os == 'Linux' || runner.os == 'Windows'
- name: OpenCL (Linux x86_64)
run: sudo apt-get install -y --no-install-recommends ocl-icd-opencl-dev
if: runner.os == 'Linux'
# Workaround to resolve link error with C:\msys64\mingw64\bin\libclang.dll
- name: Remove msys64
run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
if: runner.os == 'Windows'
- name: install webkit2gtk (ubuntu only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.0-dev libappindicator3-dev
# Imports PFX Certificate into keystore, allows Tauri to then sign the exe without being passed the private key.
# This normally should not be required on CI-Tests, but due to the way that tauri has its code signing configuration for windows it is required that we sign or the build will fail.
- name: import windows certificate
if: runner.os == 'Windows'
env:
WINDOWS_PFX: ${{ secrets.CERTIFICATE_WINDOWS_PFX }}
WINDOWS_PFX_PASSWORD: ${{ secrets.CERTIFICATE_WINDOWS_PASSWORD }}
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate/tempCert.txt -Value $env:WINDOWS_PFX
certutil -decode certificate/tempCert.txt certificate/certificate.pfx
Remove-Item –path certificate -include tempCert.txt
Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_PFX_PASSWORD -Force -AsPlainText)
- name: install app dependencies and build it (macos)
# sometimes it fails downloading packages, so set a timeout https://github.com/yarnpkg/yarn/issues/4890
run: yarn install --network-timeout 1000000 && yarn build
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
if: runner.os == 'macOS'
- name: install app dependencies and build it with opencl (windos & linux)
# sometimes it fails downloading packages, so set a timeout https://github.com/yarnpkg/yarn/issues/4890
run: yarn install --network-timeout 1000000 && yarn build -c ./src-tauri/tauri.opencl.conf.json
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
if: runner.os == 'Linux' || runner.os == 'Windows'
- name: tauri run
uses: tauri-apps/tauri-action@v0.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
clippy-fmt:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- macos-12
- windows-2022
runs-on: ${{ matrix.os }}
steps:
- name: git checkout
uses: actions/checkout@v2
# For sloth256-189 Wasm support we need `llvm-ar`, which is not available by default
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "14.0"
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 16
- name: install Rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-08-12
target: wasm32-unknown-unknown
override: true
components: rustfmt, clippy
- name: CUDA toolchain
uses: Jimver/cuda-toolkit@v0.2.6
if: runner.os == 'Linux' || runner.os == 'Windows'
- name: OpenCL (Linux x86_64)
run: sudo apt-get install -y --no-install-recommends ocl-icd-opencl-dev
if: runner.os == 'Linux'
# Workaround to resolve link error with C:\msys64\mingw64\bin\libclang.dll
- name: Remove msys64
run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
if: runner.os == 'Windows'
- name: install webkit2gtk (ubuntu only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.0-dev libappindicator3-dev
- name: install app dependencies
# sometimes it fails downloading packages, so set a timeout https://github.com/yarnpkg/yarn/issues/4890
run: yarn install --network-timeout 1000000
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
- name: run unit tests
run: yarn test
- name: build UI
run: yarn quasar build -m pwa
- name: fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path src-tauri/Cargo.toml --all -- --check
- name: clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path src-tauri/Cargo.toml -- -D warnings