1
+ name : CI
2
+
3
+ on :
4
+ push :
5
+ branches : [main]
6
+ pull_request :
7
+
8
+ # ensure that the workflow is only triggered once per PR, subsequent pushes to the PR will cancel
9
+ # and restart the workflow. See https://docs.github.com/en/actions/using-jobs/using-concurrency
10
+ concurrency :
11
+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12
+ cancel-in-progress : true
13
+
14
+ env :
15
+ RUST_BACKTRACE : 1
16
+ RUST_TEST_THREADS : 1
17
+ CARGO_TERM_COLOR : always
18
+
19
+ jobs :
20
+ lint :
21
+ name : Lint
22
+ runs-on : ubuntu-latest
23
+ timeout-minutes : 10
24
+ steps :
25
+ - uses : actions/checkout@v4
26
+
27
+ - name : Cache dependencies
28
+ uses : Swatinem/rust-cache@v2
29
+
30
+ - name : Install taplo
31
+ uses : baptiste0928/cargo-install@v3
32
+ with :
33
+ crate : taplo-cli
34
+
35
+ - name : Check format
36
+ run : |
37
+ cargo fmt --all -- --check
38
+ cargo clippy --all-targets -- -D warnings
39
+
40
+ - name : Check typos
41
+ uses : crate-ci/typos@master
42
+
43
+ - name : Check toml format
44
+ run : taplo validate --colors never --no-schema
45
+
46
+ test :
47
+ name : test
48
+ runs-on : ubuntu-latest
49
+ timeout-minutes : 10
50
+ defaults :
51
+ run :
52
+ working-directory : ./packages/hub
53
+
54
+ steps :
55
+ - uses : actions/checkout@v3
56
+
57
+ - uses : taiki-e/install-action@v2
58
+ with :
59
+ tool : nextest
60
+
61
+ - name : Cache dependencies
62
+ uses : Swatinem/rust-cache@v2
63
+
64
+ - name : Run migration tests
65
+ run : cargo nextest run
66
+
67
+ - name : Run tests
68
+ run : cargo nextest run
69
+
70
+ - name : Publish Test Report
71
+ uses : mikepenz/action-junit-report@v4
72
+ if : success() || failure() # always run even if the previous step fails
73
+ with :
74
+ report_paths : ' **/target/nextest/default/junit.xml'
75
+
76
+ # empty job for branch protection
77
+ ci-check :
78
+ runs-on : ubuntu-latest
79
+ needs : [lint, test]
80
+ timeout-minutes : 1
0 commit comments