Fix hashset/hashmap non-basic fallback to use Collection protocol #659
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust | |
| run: rustup toolchain install stable --profile minimal -c rustfmt -c clippy | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - name: Check formatting | |
| run: cargo fmt --check | |
| - name: Clippy | |
| run: cargo clippy --all-features --tests -- -D warnings | |
| - name: Install zizmor | |
| run: pipx install zizmor==1.23.1 | |
| - name: Run zizmor | |
| run: zizmor --format plain .github/ | |
| - name: Check `cargo package` | |
| # creates a .crate for distribution and verifies it can build in isolation | |
| # see https://doc.rust-lang.org/cargo/commands/cargo-package.html | |
| run: cargo package --workspace | |
| test: | |
| name: test (${{ matrix.rust }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| rust: ["1.86", stable] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust | |
| run: rustup toolchain install ${{ matrix.rust }} --profile minimal && rustup default ${{ matrix.rust }} | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| - name: Run tests | |
| run: RUST_BACKTRACE=1 cargo test | |
| test-all-features: | |
| name: test-all-features (${{ matrix.rust }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| rust: ["1.86", stable] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust | |
| run: rustup toolchain install ${{ matrix.rust }} --profile minimal && rustup default ${{ matrix.rust }} | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| - name: Run tests with all features | |
| run: RUST_BACKTRACE=1 cargo test --all-features | |
| docs: | |
| name: docs | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust | |
| run: rustup toolchain install nightly --profile minimal && rustup default nightly | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - name: Install cargo-docs-rs | |
| run: cargo install --locked cargo-docs-rs | |
| - name: Build docs | |
| env: | |
| RUSTDOCFLAGS: "-D warnings" | |
| run: cargo docs-rs | |
| # test with the minimal versions of all our dependencies | |
| test-minimal-versions: | |
| name: test-minimal-versions | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust | |
| run: rustup toolchain install nightly --profile minimal && rustup default nightly | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| - name: Generate minimal versions lockfile | |
| run: cargo generate-lockfile -Z minimal-versions | |
| - name: Run tests | |
| # --locked tells cargo not to update the lockfile. this makes sure we use the lockfile we just generated | |
| # and don't regenerate it for non-minimal versions. | |
| run: HEGEL_RUNNING_TESTS_WITH_RUST_NIGHTLY=1 RUST_BACKTRACE=1 cargo test --locked --all-features | |
| compile-examples: | |
| name: compile-examples (${{ matrix.rust }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| rust: ["1.86", stable] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust | |
| run: rustup toolchain install ${{ matrix.rust }} --profile minimal && rustup default ${{ matrix.rust }} | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - name: Compile examples | |
| run: cargo build --examples --all-features | |
| coverage: | |
| name: coverage | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust | |
| run: rustup toolchain install stable --profile minimal -c llvm-tools-preview | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - name: Install cargo-llvm-cov | |
| run: cargo install --locked cargo-llvm-cov | |
| - name: Install just | |
| run: sudo apt-get update && sudo apt-get install -y just | |
| - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| - name: Run coverage | |
| run: RUST_BACKTRACE=1 just coverage | |
| conformance: | |
| name: conformance | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust | |
| run: rustup toolchain install stable --profile minimal | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - name: Install just | |
| run: sudo apt-get update && sudo apt-get install -y just | |
| - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| - name: Run conformance tests | |
| run: just conformance | |
| nix: | |
| name: nix | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: cachix/install-nix-action@1ca7d21a94afc7c957383a2d217460d980de4934 # v31.10.1 | |
| - name: Install just | |
| run: sudo apt-get update && sudo apt-get install -y just | |
| - name: lint | |
| run: just check-format-nix | |
| release: | |
| name: release | |
| if: github.event_name == 'push' && github.repository == 'hegeldev/hegel-rust' | |
| needs: [lint, test, test-all-features, test-minimal-versions, docs, coverage, conformance, nix] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| # id-token: "enables the workflow to request and use an OIDC token from GitHub's OIDC provider". | |
| # Used by our trusted publishing flow | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Check for RELEASE.md | |
| id: check | |
| run: | | |
| if [ ! -f RELEASE.md ]; then | |
| echo "skip=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Generate app token | |
| if: steps.check.outputs.skip != 'true' | |
| uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.HEGEL_RELEASE_APP_ID }} | |
| private-key: ${{ secrets.HEGEL_RELEASE_APP_PRIVATE_KEY }} | |
| repositories: hegel-rust | |
| - name: Re-checkout with app token # zizmor: ignore[artipacked] | |
| if: steps.check.outputs.skip != 'true' | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Release | |
| if: steps.check.outputs.skip != 'true' | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| HEGEL_RELEASE_APP_SLUG: ${{ steps.app-token.outputs.app-slug }} | |
| run: python .github/scripts/release.py release | |
| - name: Install Rust | |
| if: steps.check.outputs.skip != 'true' | |
| run: rustup toolchain install stable --profile minimal | |
| - name: Authenticate with crates.io | |
| if: steps.check.outputs.skip != 'true' | |
| uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1.0.3 | |
| id: crates-io-auth | |
| - name: Publish hegeltest-macros | |
| if: steps.check.outputs.skip != 'true' | |
| run: cargo publish -p hegeltest-macros | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token }} | |
| - name: Wait for crates.io index | |
| if: steps.check.outputs.skip != 'true' | |
| run: | | |
| VERSION=$(grep '^version' hegel-macros/Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/') | |
| echo "waiting for hegeltest-macros $VERSION to appear on crates.io..." | |
| for i in $(seq 1 60); do | |
| if cargo search hegeltest-macros | grep -q "\"$VERSION\""; then | |
| exit 0 | |
| fi | |
| sleep 3 | |
| done | |
| echo "Timed out waiting for hegeltest-macros to appear on Crates.io" | |
| exit 1 | |
| - name: Publish hegeltest | |
| if: steps.check.outputs.skip != 'true' | |
| run: cargo publish -p hegeltest | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token }} | |
| - name: Push to main or open PR | |
| if: steps.check.outputs.skip != 'true' | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: python .github/scripts/release.py push-or-pr |