feat: migrate github actions to woodpecker

This commit is contained in:
JasterV 2026-03-07 01:13:53 +01:00
parent aed02daabb
commit 3dc7b689a8
7 changed files with 141 additions and 132 deletions

View file

@ -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

View file

@ -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

View file

@ -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 }}

23
.woodpecker/cd.yml Normal file
View file

@ -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

17
.woodpecker/ci.yml Normal file
View file

@ -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

51
Makefile.toml Normal file
View file

@ -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"]

50
deny.toml Normal file
View file

@ -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 = []