28
28
29
29
jobs :
30
30
linux-build :
31
- runs-on : ubuntu-22.04
31
+ runs-on : buildjet-8vcpu- ubuntu-2204
32
32
timeout-minutes : 45
33
33
strategy :
34
34
matrix :
41
41
CXX : g++-12
42
42
steps :
43
43
- uses : actions/checkout@v4
44
+ # pin the toolchain version to avoid surprises
45
+ - uses : actions-rust-lang/setup-rust-toolchain@v1
46
+ if : ${{ matrix.toolchain == 'stable' }}
47
+ with :
48
+ toolchain : " 1.76.0"
49
+ cache-workspaces : " src/rust"
50
+ # Disable full debug symbol generation to speed up CI build and keep memory down
51
+ # "1" means line tables only, which is useful for panic tracebacks.
52
+ rustflags : " -C debuginfo=1"
53
+ components : " rustfmt,clippy"
54
+ - uses : actions-rust-lang/setup-rust-toolchain@v1
55
+ if : ${{ matrix.toolchain != 'stable' }}
56
+ with :
57
+ toolchain : " nightly"
58
+ cache-workspaces : " src/rust"
59
+ # Disable full debug symbol generation to speed up CI build and keep memory down
60
+ # "1" means line tables only, which is useful for panic tracebacks.
61
+ rustflags : " -C debuginfo=1"
62
+ components : " rustfmt,clippy"
44
63
- uses : Swatinem/rust-cache@v2
45
64
with :
65
+ prefix-key : " buildjet-v1"
46
66
workspaces : rust
67
+ cache-provider : " buildjet"
47
68
- name : Install dependencies
48
69
run : |
49
70
sudo apt update
@@ -52,25 +73,29 @@ jobs:
52
73
rustup component add rustfmt
53
74
- name : Run cargo fmt
54
75
run : cargo fmt --check
55
- # split everything us so we know what's slow.
56
- - name : Build
57
- run : |
58
- cargo build --all-features --tests
59
76
- name : Start DynamoDB local for tests
60
77
if : ${{ matrix.toolchain == 'stable' }}
61
78
run : |
62
79
docker run -d -e AWS_ACCESS_KEY_ID=DUMMYKEY -e AWS_SECRET_ACCESS_KEY=DUMMYKEY -p 8000:8000 amazon/dynamodb-local
80
+ - name : Install cargo-llvm-cov
81
+ uses : taiki-e/install-action@cargo-llvm-cov
63
82
- name : Run tests
64
83
if : ${{ matrix.toolchain == 'stable' }}
65
84
run : |
66
- cargo test --features dynamodb,tensorflow,dynamodb_tests,cli
85
+ cargo llvm-cov --workspace --codecov --output-path coverage.codecov --features dynamodb,tensorflow,dynamodb_tests,cli
67
86
- name : Run tests (nightly)
68
87
if : ${{ matrix.toolchain != 'stable' }}
69
88
run : |
70
89
cargo test
71
- - name : Build benchmarks
90
+ - name : Upload coverage to Codecov
72
91
if : ${{ matrix.toolchain == 'stable' }}
73
- run : cargo build --benches
92
+ uses : codecov/codecov-action@v4
93
+ with :
94
+ token : ${{ secrets.CODECOV_TOKEN }}
95
+ codecov_yml_path : codecov.yml
96
+ files : coverage.codecov
97
+ flags : unittests
98
+ fail_ci_if_error : false
74
99
linux-arm :
75
100
runs-on : buildjet-4vcpu-ubuntu-2204-arm
76
101
timeout-minutes : 30
89
114
- name : Run tests
90
115
run : |
91
116
cargo test --all-features -- --test-threads 1
92
- clippy :
117
+ clippy_and_benchmark :
93
118
runs-on : ubuntu-22.04
94
119
timeout-minutes : 30
95
120
steps :
@@ -103,6 +128,8 @@ jobs:
103
128
sudo apt install -y protobuf-compiler libssl-dev
104
129
- name : Run clippy
105
130
run : cargo clippy --features cli,dynamodb,tensorflow,dynamodb_tests --tests --benches -- -D warnings
131
+ - name : Build benchmarks
132
+ run : cargo build --benches
106
133
mac-build :
107
134
runs-on : " macos-14"
108
135
timeout-minutes : 45
0 commit comments