en/.forgejo/workflows/verify.yaml
jutty 5ef895d878
Some checks failed
/ verify (push) Has been cancelled
CI: Simplify verify action by leveraging packaged defaults
2026-06-24 02:07:12 -03:00

69 lines
1.7 KiB
YAML

on:
push:
branches:
- '*'
paths:
- src/**
- static/graph*
- static/welcome.toml
- .forgejo/**
- .justfile
- Cargo.toml
- Cargo.lock
jobs:
verify:
runs-on: docker
timeout-minutes: 20
container:
image: rust:slim
steps:
- name: Install action dependencies
run: >
apt-get install --no-install-recommends --update -y
nodejs git xz-utils nix
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-tags: true
- name: Cleanup checkout action dependencies
run: >
apt-get purge -y nodejs
- name: Set up Rust toolchain
run: |
rust_version=$(
grep '^rust-version = "' Cargo.toml \
| cut -d '"' -f 2
)
su ci -c "
rustup default '$rust_version'
# rustup toolchain install nightly
# rustup component add llvm-tools
# rustup component add --toolchain nightly rustfmt clippy
# rustup target add \
# x86_64-unknown-linux-musl \
# x86_64-unknown-linux-gnu
"
- name: Set up CI user
run: |
useradd -m ci
chown -R ci:ci "$FORGEJO_WORKSPACE" /nix
printf '[safe]\ndirectory = %s\n' "$FORGEJO_WORKSPACE" \
> /etc/gitconfig
- name: Set up Nix
run: |
echo experimental-features = nix-command flakes \
>> /etc/nix/nix.conf
- name: Assess
run: |
ENV_PATH=$PATH su ci -c "
nix develop path:$FORGEJO_WORKSPACE -c \
just -f $FORGEJO_WORKSPACE/.justfile verify
"