Fix link to datawal in README #6
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: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-D warnings" | |
| jobs: | |
| rust: | |
| name: rust (${{ matrix.toolchain }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| toolchain: [stable, "1.75.0"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain (${{ matrix.toolchain }}) | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| components: rustfmt, clippy | |
| - name: Cache cargo registry and build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-${{ matrix.toolchain }}- | |
| - name: cargo fmt --check | |
| if: matrix.toolchain == 'stable' | |
| run: cargo fmt --all -- --check | |
| - name: cargo check | |
| run: cargo check --all-targets | |
| - name: cargo clippy | |
| if: matrix.toolchain == 'stable' | |
| run: cargo clippy --all-targets -- -D warnings | |
| - name: cargo test | |
| run: cargo test --all-targets | |
| - name: cargo doc | |
| if: matrix.toolchain == 'stable' | |
| run: cargo doc --no-deps | |
| env: | |
| RUSTDOCFLAGS: "-D warnings" | |
| publish-dry-run: | |
| name: cargo publish --dry-run | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain (stable) | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry and build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-publish-${{ hashFiles('**/Cargo.lock') }} | |
| - name: cargo publish --dry-run | |
| run: cargo publish --dry-run | |
| release: | |
| name: cargo publish (safeatomic-rs) | |
| needs: [rust, publish-dry-run] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain (stable) | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Verify tag matches Cargo.toml version | |
| run: | | |
| set -euo pipefail | |
| tag="${GITHUB_REF_NAME#v}" | |
| ver="$(grep -E '^version' Cargo.toml | head -1 | sed -E 's/.*"([^"]+)".*/\1/')" | |
| echo "tag=$tag cargo=$ver" | |
| if [ "$tag" != "$ver" ]; then | |
| echo "ERROR: tag v$tag does not match Cargo.toml version $ver" | |
| exit 1 | |
| fi | |
| - name: cargo publish | |
| run: cargo publish | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |