diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 93eb2f1..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "cargo" - directory: "/" - schedule: - interval: "daily" - # Check for cargo updates at 3am UTC - time: "03:00" - open-pull-requests-limit: 10 - groups: - batch: - applies-to: version-updates - patterns: - - "*" - - package-ecosystem: "rust-toolchain" - directory: "/" - schedule: - interval: weekly - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - # Check for cargo updates at 3am UTC - time: "03:00" - open-pull-requests-limit: 3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e18a0ea..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Rust - -on: - push: - branches: ["main"] - pull_request: - branches: ["main"] - -env: - CARGO_TERM_COLOR: always - -jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: --all - - fmt: - name: Rustfmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - clippy: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add clippy - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-targets -- -D warnings diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 8ed63f7..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Release-plz -on: - push: - branches: - - main -jobs: - # Release unpublished packages. - release-plz-release: - name: Release-plz release - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - &checkout - name: Checkout repository - uses: actions/checkout@v6 - with: - fetch-depth: 0 - persist-credentials: false - - &install-rust - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - - name: Run release-plz - uses: release-plz/action@v0.5 - with: - command: release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - # Create a PR with the new versions and changelog, preparing the next release. - release-plz-pr: - name: Release-plz PR - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - concurrency: - group: release-plz-${{ github.ref }} - cancel-in-progress: false - steps: - - *checkout - - *install-rust - - name: Run release-plz - uses: release-plz/action@v0.5 - with: - command: release-pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.woodpecker/cd.yml b/.woodpecker/cd.yml new file mode 100644 index 0000000..ce00f64 --- /dev/null +++ b/.woodpecker/cd.yml @@ -0,0 +1,23 @@ +when: + event: push + branch: main + +depends_on: + - ci + +steps: + - name: Release unpublished + image: codeberg.org/jasterv/rust-magic-release:latest + pull: true + settings: + token: + from_secret: CODEBERG_TOKEN + crates_io_token: + from_secret: CRATES_IO_TOKEN + + - name: Update PR + image: codeberg.org/jasterv/release-plz-update-pr:latest + pull: true + settings: + token: + from_secret: CODEBERG_TOKEN diff --git a/.woodpecker/ci.yml b/.woodpecker/ci.yml new file mode 100644 index 0000000..88bdb12 --- /dev/null +++ b/.woodpecker/ci.yml @@ -0,0 +1,17 @@ +when: + - event: [push, pull_request] + branch: main + +steps: + lint: + image: codeberg.org/jasterv/rust-ci:1.93 + commands: + - cargo make -p ci fmt-check + - cargo make -p ci clippy + - cargo make -p ci deny-check + - cargo make -p ci docs + + test: + image: codeberg.org/jasterv/rust-ci:1.93 + commands: + - cargo make -p ci test diff --git a/Makefile.toml b/Makefile.toml new file mode 100644 index 0000000..675f56d --- /dev/null +++ b/Makefile.toml @@ -0,0 +1,51 @@ +[config] +default_to_workspace = false + +[tasks.build] +description = "Build binaries" +command = "cargo" +args = ["build", "--workspace", "--all-features"] + +[tasks.clippy] +description = "Runs clippy." +clear = true +command = "cargo" +args = [ + "clippy", + "--all-targets", + "--all-features", + "--workspace", + "--", + "-D", + "warnings", + "-W", + "clippy::dbg_macro", +] + +[tasks.fmt-check] +description = "Runs the cargo rustfmt plugin during CI." +command = "cargo" +args = ["fmt", "--all", "--", "--check"] + +[tasks.deny-check] +description = "Runs the cargo deny plugin during CI." +command = "cargo" +args = ["deny", "check"] + +[tasks.test] +description = "Runs tests." +clear = true +run_task = { name = [ + "doc-tests", + "nextest", +], fork = true } + +[tasks.nextest] +description = "Runs tests without dependencies." +command = "cargo" +args = ["nextest", "run", "--no-fail-fast", "${@}"] + +[tasks.doc-tests] +description = "Run doc tests" +command = "cargo" +args = ["test", "--doc"] diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000..3870f63 --- /dev/null +++ b/deny.toml @@ -0,0 +1,50 @@ +[graph] +targets = [] +all-features = false +no-default-features = false + +[output] +feature-depth = 1 + +[advisories] +version = 2 +# The path where the advisory database is cloned/fetched into +db-path = "~/.cargo/advisory-db" +# The url(s) of the advisory databases to use +db-urls = ["https://github.com/rustsec/advisory-db"] +# The lint level for crates that have been yanked from their source registry +yanked = "warn" +ignore = [] + + +[licenses] +allow = ["Unicode-3.0", "Apache-2.0", "MIT"] +confidence-threshold = 0.8 +exceptions = [] + +[licenses.private] +ignore = false +registries = [] + +[bans] +multiple-versions = "warn" +wildcards = "allow" +highlight = "all" +workspace-default-features = "allow" +external-default-features = "allow" +allow = [] +deny = [] + +skip = [] +skip-tree = [] + +[sources] +unknown-registry = "warn" +unknown-git = "warn" +allow-registry = ["https://github.com/rust-lang/crates.io-index"] +allow-git = [] + +[sources.allow-org] +github = [] +gitlab = [] +bitbucket = []