52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
name: source
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [next]
|
|
|
|
concurrency:
|
|
group: alkane-toolkit-source-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: alkane-fast
|
|
container:
|
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:9d2a992bbcb91014af3c85d2e1ec8c5990701cecf83fd06c8d46f9ef13dbd948
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Check changed source
|
|
run: |
|
|
base="$(git merge-base HEAD origin/next)"
|
|
git diff --check "$base" HEAD
|
|
python3 - <<'PY'
|
|
from pathlib import Path
|
|
for path in Path('ci').glob('*.py'):
|
|
compile(path.read_text(), str(path), 'exec')
|
|
PY
|
|
for script in ci/*.sh scripts/*.sh; do
|
|
bash -n "$script"
|
|
done
|
|
- name: Check non-GUI Rust format
|
|
run: |
|
|
rustup component add rustfmt
|
|
cargo fmt --check \
|
|
--package alkane-core \
|
|
--package alkane-discovery \
|
|
--package alkane-access \
|
|
--package alkane-flash \
|
|
--package alkane-artifacts \
|
|
--package alkane-cli
|
|
- name: Check non-GUI Rust crates
|
|
env:
|
|
CARGO_TARGET_DIR: target
|
|
run: |
|
|
cargo check --offline --locked \
|
|
-p alkane-core -p alkane-discovery -p alkane-access \
|
|
-p alkane-flash -p alkane-artifacts -p alkane-cli
|
|
- name: Clean generated work
|
|
if: always()
|
|
run: python3 ci/cleanup-generated.py
|