chore(release): add release-plz configuration (#150) #426
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: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| CARGO_TERM_COLOR: always | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| fmt: | |
| name: fmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: check formatting | |
| run: cargo fmt -- --check | |
| - name: Cache Cargo dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| clippy: | |
| name: clippy | |
| runs-on: ubuntu-latest | |
| permissions: | |
| checks: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Run clippy action | |
| uses: clechasseur/rs-clippy-check@v3 | |
| - name: Cache Cargo dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| doc: | |
| name: doc | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust nightly | |
| uses: dtolnay/rust-toolchain@nightly | |
| - name: Run cargo doc | |
| run: cargo doc --no-deps --all-features | |
| env: | |
| RUSTDOCFLAGS: --cfg docsrs | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| name: test ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install wasm-pack | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: wasm-pack | |
| - name: cargo generate-lockfile | |
| if: hashFiles('Cargo.lock') == '' | |
| run: cargo generate-lockfile | |
| - name: cargo test --locked | |
| run: cargo test --locked --all-features --all-targets | |
| - name: cargo test --doc | |
| run: cargo test --doc --all-features | |
| - name: Cache Cargo dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run browser headless tests | |
| run: wasm-pack test --firefox --headless | |
| generate-template: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| template: | |
| - simple | |
| env: | |
| PROJECT_NAME: ${{ matrix.template }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Run cargo generate | |
| uses: cargo-generate/[email protected] | |
| with: | |
| name: ${{ matrix.template }} | |
| template: templates/${{ matrix.template }} | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cargo check | |
| # we need to move the generated project to a temp folder, away from the template project | |
| # otherwise cargo runs would fail | |
| # see https://github.com/rust-lang/cargo/issues/9922 | |
| run: | | |
| mv ${{ env.PROJECT_NAME }} ${{ runner.temp }}/ | |
| cd ${{ runner.temp }}/${{ env.PROJECT_NAME }} | |
| cargo check --tests |