cicd: manual deploy #27
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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*.*.*' | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
name: Lint Rust Workspace | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup update | |
- run: cargo clippy --workspace -- -D warnings | |
format: | |
name: Format Rust Workspace | |
needs: | |
- lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup update | |
- run: cargo fmt --all -- --check | |
build_and_test: | |
name: Build and Test Rust Workspace | |
needs: | |
- format | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
- beta | |
- nightly | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} | |
- run: cargo build --workspace --verbose | |
- run: cargo test --workspace --verbose | |
build_and_deploy: | |
name: Build and Deploy to Crates.io | |
if: startsWith(github.event.workflow_run.head_sha, 'refs/tags/') | |
needs: | |
- build_and_test | |
uses: ./.github/workflows/cd.yml | |
with: | |
tag_name: ${{ github.ref_name }} | |