Skip to content

Commit 519763a

Browse files
committed
Add Github action for checks and publishing
1 parent d564020 commit 519763a

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

.github/workflows/check.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
on:
2+
push:
3+
branches:
4+
- "main"
5+
pull_request:
6+
7+
name: check
8+
jobs:
9+
fmt:
10+
runs-on: ubuntu-latest
11+
name: Check
12+
permissions:
13+
checks: write
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
submodules: true
18+
- name: Install stable
19+
uses: actions-rs/toolchain@v1
20+
with:
21+
profile: minimal
22+
toolchain: stable
23+
components: rustfmt
24+
- name: cargo fmt --check
25+
uses: actions-rs/cargo@v1
26+
with:
27+
command: fmt
28+
args: --check
29+
- name: cargo clippy
30+
uses: actions-rs/clippy-check@v1
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
34+
test:
35+
runs-on: ubuntu-latest
36+
name: Run test suite
37+
steps:
38+
- uses: actions/checkout@v3
39+
with:
40+
submodules: true
41+
- name: Install nightly
42+
uses: actions-rs/toolchain@v1
43+
with:
44+
profile: minimal
45+
toolchain: nightly
46+
default: true
47+
- name: cargo test
48+
uses: actions-rs/cargo@v1
49+
with:
50+
command: test
51+
args: --all-features
52+
- name: Run abort tests
53+
run: ./abort_tests.sh

.github/workflows/publish.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
on:
2+
workflow_dispatch:
3+
4+
name: publish
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
name: Publish
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions-rs/toolchain@v1
12+
with:
13+
toolchain: stable
14+
override: true
15+
- uses: katyo/publish-crates@v1
16+
with:
17+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)