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 — 8 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 " 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 release into your framework's format: CounterStrikeSharp, Metamod/SourceMod, ModSharp, Swiftly, Plugify, a typed C# SDK, or the Dota script API. A `--format` names WHO the output is for and writes every file that consumer reads, so `--out` is a directory. Download it, `chmod +x`, and point it at the `rosetta-.json` from a per-game release (`cs2-latest`, `dota2-latest`): `source2rosetta-gen --from rosetta-cs2.json --format cssharp --out ./out`. Usage: see `crates/source2rosetta-core/README.md`. Linux x86-64."