Add github workflows

This commit is contained in:
TheAwiteb 2024-01-29 23:24:04 +03:00
parent c888f82371
commit d2762e830e
No known key found for this signature in database
GPG key ID: ABF818BD15DC2D34
3 changed files with 80 additions and 0 deletions

1
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1 @@
github: "TheAwiteb"

35
.github/workflows/cd.yml vendored Normal file
View 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
View 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