Skip to content

Commit 2134fd2

Browse files
feat(ci): add basic workflows
1 parent 55191c7 commit 2134fd2

File tree

5 files changed

+187
-52
lines changed

5 files changed

+187
-52
lines changed

.github/workflows/dprint.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Lints
2+
3+
on:
4+
push:
5+
branches: [develop]
6+
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
8+
workflow_dispatch:
9+
schedule: [cron: "40 1 * * *"]
10+
11+
concurrency:
12+
group: dprint-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
14+
15+
permissions:
16+
contents: read
17+
18+
env:
19+
RUSTFLAGS: -Dwarnings
20+
21+
jobs:
22+
dprint:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
26+
- name: Check dprint formatting
27+
run: dprint check

.github/workflows/lints.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Lints
2+
3+
on:
4+
push:
5+
branches: [develop]
6+
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
8+
workflow_dispatch:
9+
schedule: [cron: "40 1 * * *"]
10+
11+
concurrency:
12+
group: lints-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
14+
15+
permissions:
16+
contents: read
17+
18+
env:
19+
RUSTFLAGS: -Dwarnings
20+
21+
jobs:
22+
lint:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- uses: taiki-e/install-action@cargo-hack
30+
31+
- name: Install latest nightly
32+
run: rustup toolchain install nightly --component rustfmt --allow-downgrade
33+
34+
- name: rustfmt
35+
run: make check-fmt
36+
37+
- name: clippy
38+
run: make clippy
39+
40+
- name: rustdoc
41+
run: make doc
42+
43+
- name: feature compatibility
44+
run: make check-features
45+
46+
- run: make is-dirty
47+
48+
deny-bans-licenses-sources:
49+
name: cargo deny (bans, licenses, sources)
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
53+
- run: cargo deny --manifest-path ${{ inputs.manifest-path || './Cargo.toml' }} check bans licenses sources --hide-inclusion-graph
54+
55+
deny-advisories:
56+
name: cargo deny (advisories)
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
60+
- run: cargo deny --manifest-path ${{ inputs.manifest-path || './Cargo.toml' }} check advisories --hide-inclusion-graph
61+
62+
check-unused-deps:
63+
name: Check Unused Dependencies (${{ matrix.flags }})
64+
strategy:
65+
matrix:
66+
flags: ["--all-features", "--no-default-features"]
67+
fail-fast: false
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
71+
- name: Install latest nightly
72+
run: rustup toolchain install nightly --component udeps --allow-downgrade
73+
- name: Run Cargo Udeps
74+
run: cargo +nightly udeps ${{ matrix.flags }}

.github/workflows/pr_title.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "PR title"
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
- synchronize
10+
- ready_for_review
11+
12+
jobs:
13+
validate:
14+
name: Validate PR title
15+
runs-on: ubuntu-latest
16+
permissions:
17+
pull-requests: read
18+
steps:
19+
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
20+
with:
21+
types: |
22+
feat
23+
fix
24+
refactor
25+
chore
26+
upstream
27+
requireScope: false
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml renamed to .github/workflows/tests.yml

Lines changed: 15 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Tests
22

33
on:
44
push:
@@ -9,7 +9,7 @@ on:
99
schedule: [cron: "40 1 * * *"]
1010

1111
concurrency:
12-
group: ci-${{ github.event.pull_request.number || github.ref }}
12+
group: tests-${{ github.event.pull_request.number || github.ref }}
1313
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
1414

1515
permissions:
@@ -19,7 +19,7 @@ env:
1919
RUSTFLAGS: -Dwarnings
2020

2121
jobs:
22-
test:
22+
tests:
2323
runs-on: ubuntu-latest
2424

2525
steps:
@@ -36,55 +36,7 @@ jobs:
3636
- name: Run tests
3737
run: make test
3838

39-
lint:
40-
runs-on: ubuntu-latest
41-
42-
steps:
43-
- name: Checkout repository
44-
uses: actions/checkout@v4
45-
46-
- uses: taiki-e/install-action@cargo-hack
47-
48-
- name: Install latest nightly
49-
run: rustup toolchain install nightly --component rustfmt --allow-downgrade
50-
51-
- name: rustfmt
52-
run: make check-fmt
53-
54-
- name: clippy
55-
run: make clippy
56-
57-
- name: rustdoc
58-
run: make doc
59-
60-
- name: feature compatibility
61-
run: make check-features
62-
63-
- run: make is-dirty
64-
65-
wasm:
66-
runs-on: ubuntu-latest
67-
68-
steps:
69-
- name: Checkout repository
70-
uses: actions/checkout@v4
71-
72-
- name: rust version
73-
run: |
74-
rustc --version
75-
cargo --version
76-
77-
- uses: taiki-e/install-action@wasm-pack
78-
79-
- name: Install clang
80-
run: sudo apt-get install -y clang
81-
82-
- name: Run tests in wasm
83-
run: RUSTFLAGS='-Dwarnings --cfg getrandom_backend="wasm_js"' make wasm
84-
85-
- run: make is-dirty
86-
87-
run_tests_with_network:
39+
tests-with-network:
8840
runs-on: ubuntu-latest
8941
env:
9042
EPOCH_DURATION_MS: 10000
@@ -136,3 +88,14 @@ jobs:
13688
run: |
13789
sleep $((EPOCH_DURATION_MS / 1000)) # wait for the network to get to epoch #2
13890
make test-with-localnet
91+
92+
doctests:
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
96+
- name: doctests
97+
run: |
98+
cargo test --doc
99+
- name: rustdoc
100+
run: |
101+
cargo doc --all-features --workspace --no-deps

.github/workflows/wasm.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: WASM
2+
3+
on:
4+
push:
5+
branches: [develop]
6+
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
8+
workflow_dispatch:
9+
schedule: [cron: "40 1 * * *"]
10+
11+
concurrency:
12+
group: wasm-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
14+
15+
permissions:
16+
contents: read
17+
18+
env:
19+
RUSTFLAGS: -Dwarnings
20+
21+
jobs:
22+
wasm:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: rust version
30+
run: |
31+
rustc --version
32+
cargo --version
33+
34+
- uses: taiki-e/install-action@wasm-pack
35+
36+
- name: Install clang
37+
run: sudo apt-get install -y clang
38+
39+
- name: Run tests in wasm
40+
run: RUSTFLAGS='-Dwarnings --cfg getrandom_backend="wasm_js"' make wasm
41+
42+
- run: make is-dirty

0 commit comments

Comments
 (0)