This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
95 lines (87 loc) · 2.76 KB
/
rust_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
name: Rust CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
shared-key: "ubuntu-22.04-shared-cache"
- name: Run Rust check + clippy
run: make rust-check
build_ui:
name: Build UI
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: npm install
run: npm install --prefix ./packages/washboard
- name: npm run build
run: npm run build --prefix ./packages/washboard
unit_tests:
name: Unit Tests
strategy:
fail-fast: false # Ensure we can run the full suite even if one OS fails
matrix:
os: [ubuntu-22.04, windows-latest-8-cores, macos-11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ matrix.os }}-shared-cache"
- name: Install nextest
uses: taiki-e/install-action@nextest
# Sometimes, unit tests will get stuck executing wash during the
# loading CA certificates from the :otp store step. All you see is:
#
# > stderr log: 14:38:03.656 [info] Loading 467 CA(s) from :otp store
#
# when this happens, tests like can_download_and_start_wasmcloud get stuck and fail.
# to avoid this, we can call wash up/down and at least cause this loading as early as possible,
# hoping it does not happen again (or completes near instantaneously) during a test.
- name: Build wash
run: make build
- name: Cycle wash
run: |
cargo run -- up --detached;
sleep 10;
cargo run -- down;
- name: Run all wash & wash-lib unit tests
run: make test-wash-ci
integration_tests:
name: Integration Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
shared-key: "ubuntu-22.04-shared-cache"
- uses: acifani/setup-tinygo@v1
with:
tinygo-version: '0.27.0'
install-binaryen: 'false'
- name: Add wasm32-unknown-unknown
run: rustup target add wasm32-unknown-unknown
- name: Launch integration test services
uses: sudo-bot/action-docker-compose@latest
with:
cli-args: "-f ./tools/docker-compose.yml up --detach"
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Run integration tests
run: make test-integration-ci