Add github workflows
This commit is contained in:
parent
c888f82371
commit
d2762e830e
3 changed files with 80 additions and 0 deletions
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
github: "TheAwiteb"
|
35
.github/workflows/cd.yml
vendored
Normal file
35
.github/workflows/cd.yml
vendored
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
name: CD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v[0-9]+.[0-9]+.[0-9]+
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- name: Build Changelog 🏗
|
||||||
|
id: changelog
|
||||||
|
uses: mikepenz/release-changelog-builder-action@v4.0.0
|
||||||
|
with:
|
||||||
|
configuration: "./.github/config/changelog-builder-action.json"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
|
|
||||||
|
- name: Create Release 🖋
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'pre') }}
|
||||||
|
body: ${{steps.changelog.outputs.changelog}}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
|
|
||||||
|
- name: Publish to crates.io 🚀
|
||||||
|
uses: katyo/publish-crates@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.PAT }}
|
||||||
|
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
44
.github/workflows/ci.yml
vendored
Normal file
44
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
pull_request:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Rust build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- run: cargo build --workspace --all-features --all-targets
|
||||||
|
rustfmt:
|
||||||
|
name: Rust format
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- run: cargo fmt -- --check
|
||||||
|
check:
|
||||||
|
name: Rust check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- run: cargo check --workspace --all-features --all-targets
|
||||||
|
clippy:
|
||||||
|
name: Rust clippy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- run: cargo clippy --workspace --all-features -- -D warnings
|
||||||
|
test:
|
||||||
|
name: Rust test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- run: cargo test --workspace --all-features
|
Loading…
Reference in a new issue