-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (54 loc) · 1.84 KB
/
test.yml
File metadata and controls
68 lines (54 loc) · 1.84 KB
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
name: "Run Tests"
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Retrieve Rust version
id: rust-version
run: echo "rust-version=$(grep '^rust ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash
- name: Set up Rust tool chain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.rust-version.outputs.rust-version }}
- name: Add wasm targets
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown
- name: Setup Viceroy
run: |
if ! command -v viceroy &>/dev/null; then
cargo install viceroy --locked
fi
- name: Fetch dependencies (locked)
run: cargo fetch --locked
- name: Run workspace tests
run: cargo test --workspace --all-targets
- name: Check feature compilation
run: cargo check --workspace --all-targets --features "fastly cloudflare"
- name: Check Fastly wasm target
run: cargo check -p edgezero-adapter-fastly --features fastly --target wasm32-wasip1
- name: Check Cloudflare wasm target
run: cargo check -p edgezero-adapter-cloudflare --features cloudflare --target wasm32-unknown-unknown