diff --git a/.claude/.gitignore b/.claude/.gitignore new file mode 100644 index 00000000..53ced0f0 --- /dev/null +++ b/.claude/.gitignore @@ -0,0 +1 @@ +/settings.local.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9afb6a79..d41d4980 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,21 +16,14 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable with: - toolchain: stable components: rustfmt, clippy - name: Lint (clippy) - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-features --all-targets + run: cargo clippy --all-features --all-targets - name: Lint (rustfmt) - uses: actions-rs/cargo@v1 - with: - command: xfmt - args: --check + run: cargo xfmt --check - name: Install cargo readme uses: baptiste0928/cargo-install@v1 with: @@ -48,26 +41,17 @@ jobs: matrix: rust-version: [1.56, stable] steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust-version }} - - uses: Swatinem/rust-cache@f8f67b7515e98e4ac991ccb5c11240861e0f712b + - uses: Swatinem/rust-cache@v2 - uses: taiki-e/install-action@cargo-hack - uses: taiki-e/install-action@nextest + # Build all targets to ensure examples are built as well. - name: Build - uses: actions-rs/cargo@v1 - with: - # Build all targets to ensure examples are built as well. - command: hack - args: --feature-powerset build --all-targets + run: cargo hack --feature-powerset build --all-targets - name: Test - uses: actions-rs/cargo@v1 - with: - command: hack - args: --feature-powerset nextest run --all-targets + run: cargo hack --feature-powerset nextest run --all-targets - name: Run doctests - uses: actions-rs/cargo@v1 - with: - command: hack - args: --feature-powerset test --doc + run: cargo hack --feature-powerset test --doc diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0fb579a1..1bf8e822 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,19 +10,14 @@ jobs: name: Build and deploy documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable - name: Build env: # So that feature(doc_cfg) can be used. RUSTC_BOOTSTRAP: 1 RUSTDOCFLAGS: --cfg doc_cfg - uses: actions-rs/cargo@v1 - with: - command: doc - args: --all-features + run: cargo doc --all-features - name: Organize run: | mkdir target/gh-pages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 744bd94a..73d457ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ # adapted from https://github.com/taiki-e/cargo-hack/blob/main/.github/workflows/release.yml -name: Publish releases to GitHub +name: crates.io release on: push: tags: @@ -9,19 +9,22 @@ on: jobs: create-release: if: github.repository_owner == 'sunshowers-code' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write # Required for OIDC token exchange. + contents: write # Required for creating releases. steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 with: persist-credentials: false + - uses: rust-lang/crates-io-auth-action@v1 + id: auth - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true + uses: dtolnay/rust-toolchain@stable - run: cargo publish env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} - uses: taiki-e/create-gh-release-action@v1 with: changelog: CHANGELOG.md diff --git a/.gitignore b/.gitignore index 38db1195..ebdff5af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,3 @@ -# will have compiled files and executables -/target/ - -# These are backup files generated by rustfmt +/target **/*.rs.bk - -# IntelliJ settings /.idea diff --git a/Cargo.toml b/Cargo.toml index 436dc70e..f5231ff2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,12 @@ tokio1 = ["futures03", "tokio"] quickcheck1 = ["quickcheck", "rand"] proptest1 = ["proptest"] +[lints.clippy] +test_attr_in_doctest = "allow" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_cfg)'] } + [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "doc_cfg"]