Add CI workflow
This commit is contained in:
parent
82f1f0c63c
commit
f8186ba396
2 changed files with 32 additions and 2 deletions
23
.forgejo/workflows/check.yaml
Normal file
23
.forgejo/workflows/check.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
print-content:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: rust:slim
|
||||||
|
steps:
|
||||||
|
- name: install action dependencies
|
||||||
|
run: apt install --no-install-recommends --update -y nodejs
|
||||||
|
- name: setup toolchain
|
||||||
|
run: rustup component add rustfmt clippy
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- name: install dependencies
|
||||||
|
run: cargo install --path .
|
||||||
|
- name: cargo check
|
||||||
|
run: cargo check --all-targets
|
||||||
|
- name: format
|
||||||
|
run: cargo fmt -- --check
|
||||||
|
- name: lint
|
||||||
|
run: cargo clippy -- -Dwarnings
|
||||||
|
- name: test
|
||||||
|
run: cargo test
|
||||||
11
.justfile
11
.justfile
|
|
@ -74,10 +74,17 @@ alias rb := release-build
|
||||||
|
|
||||||
# Lint, check formatting and run tests
|
# Lint, check formatting and run tests
|
||||||
[group('checks')]
|
[group('checks')]
|
||||||
check: lint format-check test
|
check: format-check lint cargo-check test
|
||||||
|
|
||||||
alias c := check
|
alias c := check
|
||||||
|
|
||||||
|
# Run cargo check
|
||||||
|
[group('checks')]
|
||||||
|
cargo-check:
|
||||||
|
cargo check --workspace
|
||||||
|
|
||||||
|
alias cc := cargo-check
|
||||||
|
|
||||||
# Lint with Clippy
|
# Lint with Clippy
|
||||||
[group('checks')]
|
[group('checks')]
|
||||||
lint:
|
lint:
|
||||||
|
|
@ -94,7 +101,7 @@ alias fc := format-check
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
[group('checks')]
|
[group('checks')]
|
||||||
test: build
|
test:
|
||||||
cargo test
|
cargo test
|
||||||
|
|
||||||
alias t := test
|
alias t := test
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue