ci: Move workflows into .github/workflows #2
Workflow file for this run
This file contains hidden or 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: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| tags: | |
| - "v*" | |
| branches: | |
| - main | |
| jobs: | |
| rustfmt_check: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - run: cargo fmt -- --check | |
| clippy_check: | |
| name: Clippy check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: cargo-all- | |
| - run: cargo check | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: cargo-all- | |
| - run: cargo test | |
| publish_on_crates_io: | |
| name: Publish on crates.io | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags') # Only on tags | |
| needs: | |
| - rustfmt_check | |
| - clippy_check | |
| - test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} |