Skip to content

Commit 7129587

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

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on:
2+
release:
3+
types: [published]
4+
workflow_dispatch:
5+
6+
name: publish
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
name: Publish
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions-rs/toolchain@v1
14+
with:
15+
toolchain: stable
16+
override: true
17+
- uses: katyo/publish-crates@v1
18+
with:
19+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)