Skip to content

Commit 590d2ba

Browse files
committed
refactor(ci): update CI for running in docker
1 parent 33003b0 commit 590d2ba

1 file changed

Lines changed: 37 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,58 @@ on:
44
push:
55
pull_request:
66

7-
env:
8-
CARGO_TERM_COLOR: always
9-
107
jobs:
118
build_and_test:
129
name: Rustmail - latest
1310
runs-on: self-hosted
1411
env:
1512
SQLX_OFFLINE: true
13+
CARGO_TERM_COLOR: always
1614
strategy:
1715
matrix:
18-
toolchain:
19-
- stable
16+
toolchain: [stable]
17+
2018
steps:
2119
- uses: actions/checkout@v4
2220
with:
2321
clean: 'false'
2422

25-
- name: Setup Rust environment
23+
- name: Install System Libs
24+
run: |
25+
sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config build-essential
26+
27+
- name: Setup Rust
28+
run: |
29+
if ! command -v rustup &> /dev/null; then
30+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
31+
fi
32+
source "$HOME/.cargo/env"
33+
rustup default ${{ matrix.toolchain }}
34+
rustup target add wasm32-unknown-unknown
35+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
36+
37+
- name: Setup Trunk, Wasm-bindgen & Wasm-opt
2638
run: |
39+
source "$HOME/.cargo/env"
40+
41+
if ! command -v trunk &> /dev/null; then
42+
cargo install trunk --locked
43+
fi
44+
45+
if ! command -v wasm-bindgen &> /dev/null; then
46+
cargo install wasm-bindgen-cli --version 0.2.106
47+
fi
48+
49+
if ! command -v wasm-opt &> /dev/null; then
50+
wget https://github.com/WebAssembly/binaryen/releases/download/version_126/binaryen-version_126-aarch64-linux.tar.gz
51+
tar -xzf binaryen-version_126-aarch64-linux.tar.gz
52+
sudo mv binaryen-version_126/bin/wasm-opt /usr/local/bin/
53+
rm -rf binaryen-version_126*
54+
fi
55+
2756
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
28-
echo "CARGO_HOME=$HOME/.cargo" >> $GITHUB_ENV
29-
echo "RUSTUP_HOME=$HOME/.rustup" >> $GITHUB_ENV
57+
wasm-bindgen --version
58+
wasm-opt --version
3059
3160
- name: Build frontend
3261
working-directory: crates/rustmail_panel

0 commit comments

Comments
 (0)