-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from vivax3794/Github-Actions
Add github actions
- Loading branch information
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: actions/setup-rust@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Run Tests | ||
run: cargo test --all --verbose | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: actions/setup-rust@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
|
||
- name: Install Clippy and Rustfmt | ||
run: rustup component add clippy rustfmt | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Check Formatting | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Run Clippy | ||
run: cargo clippy - | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish Crates | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: actions/setup-rust@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Publish Workspace | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
run: | | ||
cargo publish --workspace --token "$CARGO_REGISTRY_TOKEN" | ||