-
-
Notifications
You must be signed in to change notification settings - Fork 37
95 lines (79 loc) · 2.56 KB
/
tests.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: Tests
on: [push, pull_request]
jobs:
xtask-test-matrix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: hecrj/setup-rust-action@v1
- name: Generate matrix
id: xtask
run: |
cargo xtask test-matrix >> "$GITHUB_OUTPUT"
outputs:
matrix: ${{ steps.xtask.outputs.test-matrix }}
test:
runs-on: ubuntu-latest
timeout-minutes: 45
needs: xtask-test-matrix
strategy:
fail-fast: false
matrix:
options: ${{ fromJson(needs.xtask-test-matrix.outputs.matrix) }}
# Service containers to run with `runner-job`
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- uses: actions/checkout@v3
-
name: Free disk space
run: |
sudo docker rmi $(docker image ls -aq) || true
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc || true
- name: Install Rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.options.toolchain }}
components: clippy,rust-docs,rustfmt
- name: Run clippy
continue-on-error: true
run: |
cargo clippy --all-targets ${{ matrix.options.cargo_args }} -- -D warnings
env:
RUST_TOOLCHAIN: ${{ matrix.options.toolchain }}
- name: Run unit tests
run: |
cargo test --all-targets ${{ matrix.options.cargo_args }} -- --nocapture
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY_SECRET }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
RUST_TOOLCHAIN: ${{ matrix.options.toolchain }}
RUST_BACKTRACE: 1
check-wasm:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: hecrj/setup-rust-action@v1
- name: Install wasm32-unknown-unknown
run: |
rustup target add wasm32-unknown-unknown
- name: Run clippy
run: |
cargo clippy --target wasm32-unknown-unknown --package bonsaidb-client -- -D warnings