Skip to content

Commit

Permalink
Add Github action for checks and publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
1c3t3a committed Dec 12, 2022
1 parent d564020 commit 7129587
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
push:
branches:
- "main"
pull_request:

name: check
jobs:
fmt:
runs-on: ubuntu-latest
name: Check
permissions:
checks: write
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
- name: cargo fmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
- name: cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

test:
runs-on: ubuntu-latest
name: Run test suite
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
default: true
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
- name: Run abort tests
run: ./abort_tests.sh
19 changes: 19 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
release:
types: [published]
workflow_dispatch:

name: publish
jobs:
publish:
runs-on: ubuntu-latest
name: Publish
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: katyo/publish-crates@v1
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit 7129587

Please sign in to comment.