diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 82dd8ab..4267d26 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,13 +2,15 @@ version: 2 updates: - package-ecosystem: cargo directory: "/" + versioning-strategy: auto schedule: - interval: weekly - day: friday + interval: monthly time: "09:00" timezone: Europe/Berlin commit-message: prefix: "chore" + cooldown: + default-days: 14 groups: cargo: patterns: @@ -17,12 +19,13 @@ updates: - package-ecosystem: github-actions directory: "/" schedule: - interval: weekly - day: friday + interval: monthly time: "09:00" timezone: Europe/Berlin commit-message: prefix: "chore" + cooldown: + default-days: 14 groups: github-actions: patterns: diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 58d57a4..0649efe 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -5,42 +5,25 @@ on: jobs: test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v7 - - uses: taiki-e/install-action@v2.87.3 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0 with: - tool: just - - run: echo "RUST_TOOLCHAIN=$(just rust-version)" >> $GITHUB_ENV - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - - uses: Swatinem/rust-cache@v2 - with: - shared-key: debug-build + cache-shared-key: debug-build + - uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0 - name: Test run: just test lint: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v7 - - uses: taiki-e/install-action@v2.87.3 - with: - tool: just - - run: | - echo "RUST_TOOLCHAIN=$(just rust-version)" >> $GITHUB_ENV - echo "RUST_TOOLCHAIN_NIGHTLY=$(just rust-nightly-version)" >> $GITHUB_ENV - - uses: dtolnay/rust-toolchain@master + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - run: cp rust-toolchain-nightly.toml rust-toolchain.toml # use nightly + - uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0 with: - toolchain: ${{ env.RUST_TOOLCHAIN_NIGHTLY }} - components: rustfmt - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} components: rustfmt, clippy - - uses: Swatinem/rust-cache@v2 - with: - shared-key: debug-build + cache-shared-key: nightly-build + - uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0 - name: Lint - run: just lint "strict" + run: just lint diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 29b91bf..c13c934 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,22 +12,18 @@ on: jobs: release: name: Release - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 - - uses: taiki-e/install-action@v2.87.3 + - uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0 with: - tool: just - - run: | - echo "RUST_TOOLCHAIN=$(just rust-version)" >> $GITHUB_ENV - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} + cache-shared-key: release + - uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0 - name: Run release-plz - uses: MarcoIeni/release-plz-action@v0.5 + uses: MarcoIeni/release-plz-action@b8d6b54b02889ff2ae2bb82e8b57c3a8fc1683a5 # v0.5.139 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/update-tools.yaml b/.github/workflows/update-tools.yaml new file mode 100644 index 0000000..3f2b81c --- /dev/null +++ b/.github/workflows/update-tools.yaml @@ -0,0 +1,80 @@ +name: Update Tool Versions + +on: + schedule: + - cron: '0 7 1 * *' # Runs at 7 AM on the 1st of every month + workflow_dispatch: # Allow manual triggering + +jobs: + update-rust: + runs-on: ubuntu-24.04 + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Get latest Rust version + id: get-rust-version + run: | + set -o pipefail + LATEST_RUST_VERSION=$(curl -s https://api.github.com/repos/rust-lang/rust/releases/latest | jq -r .tag_name | sed 's/^v//') + echo "latest_version=$LATEST_RUST_VERSION" >> $GITHUB_OUTPUT + CURRENT_RUST_VERSION=$(grep 'channel' rust-toolchain.toml | sed -E 's/channel *= *"([^"]+)".*/\1/') + echo "current_version=$CURRENT_RUST_VERSION" >> $GITHUB_OUTPUT + # Get current date for nightly + CURRENT_DATE=$(date +"%Y-%m-%d") + echo "nightly_date=$CURRENT_DATE" >> $GITHUB_OUTPUT + # Get current nightly version + CURRENT_NIGHTLY_VERSION=$(grep 'channel' rust-toolchain-nightly.toml | sed -E 's/channel *= *"([^"]+)".*/\1/') + echo "current_nightly_version=$CURRENT_NIGHTLY_VERSION" >> $GITHUB_OUTPUT + - name: Update Rust version in rust-toolchain.toml + if: steps.get-rust-version.outputs.current_version != steps.get-rust-version.outputs.latest_version + run: | + sed -i 's/channel = "[^"]*"/channel = "${{ steps.get-rust-version.outputs.latest_version }}"/g' rust-toolchain.toml + sed -i 's/channel = "[^"]*"/channel = "nightly-${{ steps.get-rust-version.outputs.nightly_date }}"/g' rust-toolchain-nightly.toml + - name: Create Pull Request for Rust + if: steps.get-rust-version.outputs.current_version != steps.get-rust-version.outputs.latest_version + uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 + with: + commit-message: "chore: update Rust versions" + title: "chore: update Rust versions" + body: | + This PR includes the following changes: + + - Update stable Rust version to ${{ steps.get-rust-version.outputs.latest_version }} + - Update nightly Rust version to nightly-${{ steps.get-rust-version.outputs.nightly_date }} + + This is an automated PR created by the update-tools GitHub Action. + branch: update-rust-version + token: ${{ secrets.BOT_ACCOUNT_PAT }} + delete-branch: true + + update-mise-tools: + runs-on: ubuntu-24.04 + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0 + with: + install: false + minimum_release_age: 14d + - name: Update mise-managed tools + run: mise upgrade --local --bump --yes + - name: Create Pull Request for mise tools + uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 + with: + commit-message: "chore: update mise-managed tools" + title: "chore: update mise-managed tools" + body: | + This PR updates non-Rust tool versions in `mise.toml` using: + + ```bash + mise upgrade --local --bump --yes + ``` + + This is an automated PR created by the update-tools GitHub Action. + branch: update-mise-tools + token: ${{ secrets.BOT_ACCOUNT_PAT }} + delete-branch: true diff --git a/Cargo.toml b/Cargo.toml index 9ce6e1b..c5bd44a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,6 @@ version = "0.0.2" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/moia-oss/tinybitset" -homepage = "https://github.com/moia-oss/tinybitset" categories = ["data-structures"] keywords = ["bitset", "stack", "small", "data-structure"] diff --git a/justfile b/justfile index 512d6a0..66e94f6 100644 --- a/justfile +++ b/justfile @@ -9,17 +9,11 @@ set quiet rust_version := `sed -nr 's/channel = "(.*)"/\1/p' rust-toolchain.toml` rust_nightly_version := `sed -nr 's/channel = "(.*)"/\1/p' rust-toolchain-nightly.toml` -rust-version: - echo '{{rust_version}}' - -rust-nightly-version: - echo '{{rust_nightly_version}}' - test: cargo test --workspace --all-targets --all-features cargo test --workspace --doc -lint strict="": +lint: cargo '+{{rust_nightly_version}}' fmt -- --check cargo clippy \ --workspace \ @@ -28,14 +22,8 @@ lint strict="": --all-targets \ --all-features \ --quiet \ - -- {{ if strict != "" { "-D warnings" } else { "" } }} + -- -D warnings cargo doc --all --no-deps --document-private-items --all-features --quiet fmt: cargo '+{{rust_nightly_version}}' fmt - -udeps: - cargo '+{{rust_nightly_version}}' udeps - -install-nightly: - rustup toolchain install '{{rust_nightly_version}}' \ No newline at end of file diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..4f1d1c5 --- /dev/null +++ b/mise.toml @@ -0,0 +1,6 @@ +[tools] +just = "1.58.0" +pinact = "5.0.0" + +[settings] +minimum_release_age = "14d" diff --git a/rust-toolchain-nightly.toml b/rust-toolchain-nightly.toml index 74f46e1..7f3f4ee 100644 --- a/rust-toolchain-nightly.toml +++ b/rust-toolchain-nightly.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-09-06" +channel = "nightly-2026-09-24" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1de01fa..6422209 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.81.0" +channel = "1.98.1"