-
Notifications
You must be signed in to change notification settings - Fork 471
176 lines (152 loc) · 4.57 KB
/
test-release.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
name: Test Aleo Release
on:
pull_request:
push:
branches:
- testnet3
paths-ignore:
- 'docs/**'
- 'documentation/**'
env:
RUST_BACKTRACE: 1
jobs:
test-package:
name: Test Package ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, ubuntu-latest]
include:
- os: ubuntu-latest
sccache-path: /home/runner/.cache/sccache
- os: macos-latest
sccache-path: /Users/runner/Library/Caches/Mozilla.sccache
env:
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: ${{ matrix.sccache-path }}
# SCCACHE_RECACHE: 1 # Uncomment this to clear cache, then comment it back out
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install sccache Ubuntu
if: matrix.os == 'ubuntu-latest'
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.2.15
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
chmod +x $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install sccache Macos
if: matrix.os == 'macos-latest'
run: |
brew update
brew install sccache
- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cache cargo registry
uses: actions/cache@v2
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Save sccache
uses: actions/cache@v2
continue-on-error: false
with:
path: ${{ matrix.sccache-path }}
key: ${{ runner.os }}-sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-sccache-
- name: Start sccache server
run: |
sccache --start-server
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
- name: Print sccache stats
run: sccache --show-stats
- name: Stop sccache server
run: sccache --stop-server || true
test-package-macos_m1:
name: Test Package macOS M1
runs-on: macos-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: /Users/runner/Library/Caches/Mozilla.sccache
steps:
- name: Xcode Select
uses: devbotsxyz/[email protected]
- name: Checkout
uses: actions/checkout@v3
- name: Install sccache
run: |
brew update
brew install sccache
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: aarch64-apple-darwin
toolchain: stable
override: true
components: rustfmt
- name: Cache cargo registry
uses: actions/cache@v2
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: m1-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
m1-cargo-
- name: Save sccache
uses: actions/cache@v2
continue-on-error: false
with:
path: /Users/runner/Library/Caches/Mozilla.sccache
key: m1-sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
m1-sccache-
- name: Start sccache server
run: |
sccache --start-server
- name: Test
run: |
SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path) \
MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) \
cargo test --all
- name: Print sccache stats
run: sccache --show-stats
- name: Stop sccache server
run: sccache --stop-server || true
test-package-windows:
name: Test Package Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Test
run: |
cargo test --all