chore: update state struct #7
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] | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: write # Needed for semantic-release to push tags | |
issues: write # Needed for semantic-release to create GitHub releases | |
pull-requests: write # Needed for semantic-release to comment on PRs | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
- name: Clippy | |
run: cargo clippy -- -D warnings | |
- name: Run tests | |
run: cargo test --all-features | |
conventional-commits: | |
name: Conventional Commits | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check conventional commits | |
uses: amannn/action-semantic-pull-request@v5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [test] | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.RELEASE_TOKEN }} # Use a custom token | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Make scripts executable | |
run: chmod +x ./scripts/bump-version.sh | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
with: | |
extra_plugins: | | |
@semantic-release/git | |
@semantic-release/changelog | |
@semantic-release/exec |