- Add checkout step before local composite action (GitHub Actions requires repo on disk to read action.yml) - Use PR base SHA for path detection in multi-commit PRs - Fail benchmarks loudly on decode errors (.expect instead of let _ =) - Document intentional encode error handling (codec may drop frames) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
97 lines
2.6 KiB
YAML
97 lines
2.6 KiB
YAML
name: CI
|
|
|
|
env:
|
|
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
|
|
VCPKG_COMMIT_ID: "120deac3062162151622ca4860575a33844ba10b"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "README.md"
|
|
push:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- ".github/**"
|
|
- "docs/**"
|
|
- "README.md"
|
|
- "res/**"
|
|
- "appimage/**"
|
|
- "flatpak/**"
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
|
|
runs-on: ${{ matrix.job.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
job:
|
|
- { target: x86_64-unknown-linux-gnu, os: ubuntu-24.04 }
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- uses: ./.github/actions/setup-linux
|
|
|
|
- name: Show version information (Rust, cargo, GCC)
|
|
shell: bash
|
|
run: |
|
|
gcc --version || true
|
|
rustup -V
|
|
rustup toolchain list
|
|
rustup default
|
|
cargo -V
|
|
rustc -V
|
|
|
|
- name: Build
|
|
run: cargo build --locked --target=${{ matrix.job.target }}
|
|
|
|
- name: Clean
|
|
run: cargo clean
|
|
|
|
- name: Set testing options
|
|
id: test-options
|
|
shell: bash
|
|
run: |
|
|
unset CARGO_TEST_OPTIONS
|
|
case ${{ matrix.job.target }} in
|
|
arm-* | aarch64-*)
|
|
CARGO_TEST_OPTIONS="--lib --bin ${PROJECT_NAME}"
|
|
;;
|
|
*)
|
|
CARGO_TEST_OPTIONS="--workspace --no-fail-fast -- --skip test_get_cursor_pos --skip test_get_key_state"
|
|
;;
|
|
esac;
|
|
echo "CARGO_TEST_OPTIONS=${CARGO_TEST_OPTIONS}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Run tests
|
|
run: cargo test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS }}
|
|
|
|
check-bench-paths:
|
|
name: Check benchmark-relevant changes
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
should-bench: ${{ steps.check.outputs.run }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- id: check
|
|
run: |
|
|
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
|
BASE="${{ github.event.pull_request.base.sha }}"
|
|
else
|
|
BASE="HEAD~1"
|
|
fi
|
|
CHANGED=$(git diff --name-only "$BASE" HEAD -- libs/scrap/ libs/hbb_common/ 2>/dev/null || echo "")
|
|
echo "run=$( [ -n "$CHANGED" ] && echo true || echo false )" >> "$GITHUB_OUTPUT"
|
|
|
|
benchmarks:
|
|
name: Benchmarks
|
|
needs: [build, check-bench-paths]
|
|
if: needs.check-bench-paths.outputs.should-bench == 'true'
|
|
uses: ./.github/workflows/_bench.yml
|