build: add forgejo workflows
This commit is contained in:
parent
3812c9efd5
commit
270de24272
3 changed files with 106 additions and 5 deletions
38
.forgejo/workflows/push-main.yml
Normal file
38
.forgejo/workflows/push-main.yml
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
name: Release Please
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-plz:
|
||||||
|
name: Release-plz
|
||||||
|
runs-on: docker
|
||||||
|
|
||||||
|
container:
|
||||||
|
image:
|
||||||
|
git.kemitix.net/kemitix/rust:v4.0.0
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Run release-plz release-pr
|
||||||
|
run: release-plz release-pr --backend gitea --git-token ${{ secrets.FORGEJO_TOKEN }}
|
||||||
|
env:
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Run release-plz release
|
||||||
|
run: release-plz release --backend gitea --git-token ${{ secrets.FORGEJO_TOKEN }}
|
||||||
|
env:
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
56
.forgejo/workflows/push-next.yml
Normal file
56
.forgejo/workflows/push-next.yml
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
name: Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- next
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: docker
|
||||||
|
|
||||||
|
container:
|
||||||
|
image:
|
||||||
|
git.kemitix.net/kemitix/rust:v4.0.0
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
toolchain:
|
||||||
|
- name: stable
|
||||||
|
- name: nightly
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Ignored Files
|
||||||
|
run: check-for-ignored
|
||||||
|
|
||||||
|
- name: Check TODOs
|
||||||
|
uses: https://git.kemitix.net/kemitix/forgejo-todo-checker@v1.3.0
|
||||||
|
|
||||||
|
- name: Machete
|
||||||
|
run: cargo +${{ matrix.toolchain.name }} machete
|
||||||
|
|
||||||
|
- name: Format
|
||||||
|
run: cargo +${{ matrix.toolchain.name }} fmt --all --check
|
||||||
|
|
||||||
|
- name: Clippy
|
||||||
|
run: cargo +${{ matrix.toolchain.name }} hack --feature-powerset clippy
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: cargo +${{ matrix.toolchain.name }} hack --feature-powerset build
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: cargo +${{ matrix.toolchain.name }} hack --feature-powerset test
|
||||||
|
|
||||||
|
# - name: Mutations
|
||||||
|
# run: cargo +${{ matrix.toolchain.name }} mutants -vV --in-place
|
||||||
|
|
17
src/main.rs
17
src/main.rs
|
@ -39,7 +39,8 @@ fn run_rename(args: &Args) -> color_eyre::Result<()> {
|
||||||
let entry = entry.context("invalid file entry")?;
|
let entry = entry.context("invalid file entry")?;
|
||||||
if entry.file_type().is_file() {
|
if entry.file_type().is_file() {
|
||||||
let path = entry.path();
|
let path = entry.path();
|
||||||
let file_name = path.file_name()
|
let file_name = path
|
||||||
|
.file_name()
|
||||||
.and_then(|n| n.to_str())
|
.and_then(|n| n.to_str())
|
||||||
.ok_or_eyre("Invalid file name")?;
|
.ok_or_eyre("Invalid file name")?;
|
||||||
|
|
||||||
|
@ -49,11 +50,17 @@ fn run_rename(args: &Args) -> color_eyre::Result<()> {
|
||||||
|
|
||||||
if path != new_path {
|
if path != new_path {
|
||||||
if args.dry_run {
|
if args.dry_run {
|
||||||
println!("Would rename:\n '{}' to\n '{}'\n",
|
println!(
|
||||||
path.display(), new_path.display());
|
"Would rename:\n '{}' to\n '{}'\n",
|
||||||
|
path.display(),
|
||||||
|
new_path.display()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
println!("Renaming:\n '{}' to\n '{}'\n",
|
println!(
|
||||||
path.display(), new_path.display());
|
"Renaming:\n '{}' to\n '{}'\n",
|
||||||
|
path.display(),
|
||||||
|
new_path.display()
|
||||||
|
);
|
||||||
std::fs::rename(path, new_path).context("renaming file")?;
|
std::fs::rename(path, new_path).context("renaming file")?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue