-
Notifications
You must be signed in to change notification settings - Fork 38
97 lines (87 loc) · 2.8 KB
/
rust.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
name: Build and Test
on: [push, pull_request]
jobs:
rustfmt-and-clippy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache of Cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-cargo-clippy
- name: Install Rust components
run: |
cargo fmt --version || rustup component add rustfmt
cargo clippy --version || rustup component add clippy
- name: Check format
run: cargo fmt --all -- --check --verbose
- name: Cargo clippy check
env:
RUSTFLAGS: -D warnings
run: cargo clippy --tests --all-features --all-targets
rust-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache of Cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-cargo-test
- name: Cache of component.gwos-evm
id: godwoken-polyjuice-cache
uses: actions/cache@v3
with:
path: |
gwos-evm/build/*generator*
gwos-evm/build/*validator*
key: component.gwos-evm-${{ hashFiles('gwos-evm/**') }}
- name: Build godwoken-polyjuice
if: steps.godwoken-polyjuice-cache.outputs.cache-hit != 'true'
working-directory: gwos-evm
run: |
test "$(moleculec --version)" = "Moleculec 0.7.2" \
|| cargo install moleculec --version 0.7.2 --force
git submodule update --init --recursive --depth=1
make all-via-docker
- name: Test all targets
run: RUST_BACKTRACE=1 cargo test --all-targets
test-generate-example-config:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache of Cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-cargo-build
- name: Test TOML serialization
run: cargo run --bin godwoken -- generate-example-config -o test.toml