Skip to content

Commit 9d7db7c

Browse files
committed
chore: add ci jobs and format toml
1 parent 91bf3f8 commit 9d7db7c

File tree

9 files changed

+133
-253
lines changed

9 files changed

+133
-253
lines changed

.cargo/config.toml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

.github/workflows/ci.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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

.github/workflows/rust.yml

-22
This file was deleted.

.taplo.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[formatting]
2+
align_comments = false
3+
allowed_blank_lines = 1
4+
array_auto_collapse = false
5+
array_auto_expand = false
6+
include = ["*.toml"]
7+
indent_string = " " # 4 spaces
8+
keys = ["dependencies"]
9+
reorder_arrays = true
10+
reorder_keys = true

.typos.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[files]
2+
extend-exclude = []
3+
ignore-files = true

0 commit comments

Comments
 (0)