Skip to content

Implementing UCI time controls #296

Implementing UCI time controls

Implementing UCI time controls #296

name: Linux Build Test
on:
pull_request:
branches: [ main ]
types: [ opened, reopened, synchronize, labeled ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: read
jobs:
plan-linux-build:
runs-on: ubuntu-slim
name: Plan Linux Build
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
should_run: ${{ steps.set-matrix.outputs.should_run }}
steps:
- id: set-matrix
env:
EVENT_ACTION: ${{ github.event.action }}
EVENT_LABEL: ${{ github.event.label.name || '' }}
HAS_PREMERGE_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') }}
run: |
SHOULD_RUN=true
if [[ "$EVENT_ACTION" == "labeled" && "$EVENT_LABEL" == "run-pre-merge-checks" ]]; then
MATRIX='{"include":[
{"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"},
{"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}
]}'
elif [[ "$EVENT_ACTION" == "synchronize" && "$HAS_PREMERGE_LABEL" == "true" ]]; then
MATRIX='{"include":[
{"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"},
{"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"},
{"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}
]}'
elif [[ "$EVENT_ACTION" == "opened" || "$EVENT_ACTION" == "reopened" || "$EVENT_ACTION" == "synchronize" ]]; then
MATRIX='{"include":[
{"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}
]}'
else
MATRIX='{"include":[]}'
SHOULD_RUN=false
fi
EOF_MARKER=$(openssl rand -hex 8)
{
echo "matrix<<$EOF_MARKER"
echo "$MATRIX"
echo "$EOF_MARKER"
echo "should_run=$SHOULD_RUN"
} >> "$GITHUB_OUTPUT"
linux-build:
needs: plan-linux-build
if: needs.plan-linux-build.outputs.should_run == 'true'
runs-on: ${{ matrix.runner }}
name: ${{ matrix.runner }} - ${{ matrix.test_preset }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.plan-linux-build.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Setup, configure, and build Linux CI
uses: ./.github/actions/_setup_configure_build_linux
with:
arch: ${{ matrix.arch }}
configure-preset: ${{ matrix.configure_preset }}
build-preset: ${{ matrix.build_preset }}
- name: Test (${{ matrix.test_preset }})
uses: ./.github/actions/_log_to_gh_summary_bash
with:
step-name: Test (${{ matrix.test_preset }})
command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure"
- name: Generate coverage HTML (${{ matrix.build_preset }})
if: matrix.build_preset == 'clang_debug'
id: htmlcov
uses: ./.github/actions/_generate_llvm_html_coverage
with:
build-preset: ${{ matrix.build_preset }}
- name: Upload coverage artifact (${{ matrix.build_preset }})
if: matrix.build_preset == 'clang_debug'
uses: actions/upload-artifact@v4
with:
name: llvm-html-coverage-${{ matrix.runner }}-${{ matrix.build_preset }}
path: ${{ steps.htmlcov.outputs.html-cov-dir }}
if-no-files-found: error