source2rosetta/.forgejo/workflows/ci.yml
Kamal Tufekcic a2922b8bad
All checks were successful
CI / fuzz (push) Successful in 1m41s
CI / lint (push) Successful in 16s
CI / test (push) Successful in 22s
initial commit
2026-07-27 10:12:04 +03:00

75 lines
2.8 KiB
YAML

name: CI
on:
push:
branches: [master]
tags: ['gen-v*']
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
lint:
runs-on: s2-runner
steps:
- uses: actions/checkout@v6.0.2
- name: cargo fmt
run: cargo fmt --all --check
- name: cargo clippy (advisory)
run: cargo clippy --all-targets --all-features --message-format=short
env:
RUSTFLAGS: ""
- name: cargo doc (no deps)
run: cargo doc --no-deps --document-private-items
env:
RUSTDOCFLAGS: "-D warnings"
fuzz:
runs-on: s2-runner
env:
RUSTFLAGS: ""
steps:
- uses: actions/checkout@v6.0.2
- name: Clear artifacts from any earlier run
run: rm -rf fuzz/artifacts
- name: Fuzz — 5 targets x 2 workers x 30s
run: bash fuzz.sh 30 2
- name: Fail on any crash / timeout / OOM
run: |
found=$(find fuzz/artifacts -type f \( -name 'crash-*' -o -name 'timeout-*' -o -name 'oom-*' \) 2>/dev/null || true)
if [ -n "$found" ]; then
echo "fuzzing produced artifacts:"; echo "$found" | sed 's/^/ /'
echo "triage: cargo +nightly fuzz tmin <target> <artifact>"
exit 1
fi
echo "no crashes / timeouts / OOMs — the offline derivation held on every explored input."
test:
runs-on: s2-runner
steps:
- uses: actions/checkout@v6.0.2
- name: cargo test
run: cargo test --release
- name: Build the gen binary (it lives in the core crate, not the workspace default build)
run: cargo build --release -p source2rosetta-core
- name: Package the gen binary
if: startsWith(github.ref, 'refs/tags/gen-v')
run: |
mkdir -p dist
cp target/release/source2rosetta-gen dist/
strip dist/source2rosetta-gen || true
(cd dist && sha256sum source2rosetta-gen > source2rosetta-gen.sha256)
- name: Publish the gen release
if: startsWith(github.ref, 'refs/tags/gen-v')
uses: https://code.forgejo.org/actions/forgejo-release@v2
with:
direction: upload
url: ${{ github.server_url }}
repo: ${{ github.repository }}
tag: ${{ github.ref_name }}
release-dir: dist
token: ${{ secrets.GITHUB_TOKEN }}
override: true
release-notes: "`source2rosetta-gen` ${{ github.ref_name }} — renders a published gamedata release into your framework's format: CounterStrikeSharp, Metamod/SourceMod, ModSharp, Swiftly, Plugify, or a typed C# SDK. Download it, `chmod +x`, and point it at the `gamedata-<game>.json` / `netvars-<game>.json` from a per-game release (`cs2-latest`, `dota2-latest`). Usage: see `crates/source2rosetta-core/README.md`. Linux x86-64."