-
Notifications
You must be signed in to change notification settings - Fork 35
96 lines (94 loc) · 3.03 KB
/
test.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
on:
pull_request:
paths-ignore:
- '**.md'
name: Test
env:
CACHE_GENERATION: 0
jobs:
test:
strategy:
matrix:
platform: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-2022, macos-13, macos-14, macos-15]
runs-on: ${{ matrix.platform }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
run: rustup update --no-self-update stable && rustup default stable
shell: bash
- name: Add wasm32-wasi Rust target
run: rustup target add wasm32-wasi
- name: Add wasm32-unknown-unknown Rust target
run: rustup target add wasm32-unknown-unknown
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
key: ${{ matrix.platform }}-cargo-v${{ env.CACHE_GENERATION }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.5
- name: Install rustfmt
run: rustup component add rustfmt
shell: bash
- name: Check formatting
run: cargo fmt --all -- --check
shell: bash
- name: test
run: make ci
shell: bash
- name: adapter
run: cargo build --release -p viceroy-component-adapter --target wasm32-unknown-unknown
# Run the trap test in an isolated job. It needs different cargo features than the usual build, so
# it entails rebuilding the whole workspace if we combine them in a single job. This way, we
# achieve some parallelism via Actions jobs.
trap-test:
strategy:
matrix:
platform: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-2022, macos-13, macos-14, macos-15]
runs-on: ${{ matrix.platform }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
run: rustup update --no-self-update stable && rustup default stable
shell: bash
- name: Add wasm32-wasi Rust target
run: rustup target add wasm32-wasi
- name: Add wasm32-unknown-unknown Rust target
run: rustup target add wasm32-unknown-unknown
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
key: ${{ matrix.platform }}-cargo-trap-v${{ env.CACHE_GENERATION }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.5
- name: trap-test
run: make trap-test-ci
shell: bash
package-check:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
run: rustup update stable && rustup default stable
shell: bash
- name: Check crates can be published
run: make package-check
shell: bash