76 lines
2 KiB
YAML
76 lines
2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
preflight:
|
|
name: Preflight (${{ matrix.os }})
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 90
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-24.04
|
|
- macos-15
|
|
|
|
env:
|
|
CC: clang
|
|
CXX: clang++
|
|
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
|
|
- name: Install Linux toolchain
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install --yes clang clang-tidy libc++-dev libc++abi-dev libseccomp-dev ninja-build python3-venv
|
|
echo "CXXFLAGS=-stdlib=libc++" >> "$GITHUB_ENV"
|
|
|
|
- name: Install macOS toolchain
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
brew install go llvm llvm@18 ninja
|
|
echo "$(brew --prefix llvm)/bin" >> "$GITHUB_PATH"
|
|
echo "CC=/usr/bin/clang" >> "$GITHUB_ENV"
|
|
echo "CXX=/usr/bin/clang++" >> "$GITHUB_ENV"
|
|
|
|
- name: Pin clang-format
|
|
run: |
|
|
python3 -m venv "$RUNNER_TEMP/clang-format"
|
|
"$RUNNER_TEMP/clang-format/bin/pip" install --disable-pip-version-check clang-format==22.1.8
|
|
echo "$RUNNER_TEMP/clang-format/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Install actionlint
|
|
run: go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.12
|
|
|
|
- name: Report toolchain
|
|
run: |
|
|
cmake --version
|
|
ninja --version
|
|
"$CXX" --version
|
|
clang-tidy --version
|
|
clang-format --version
|
|
"$(go env GOPATH)/bin/actionlint" --version
|
|
|
|
- name: Add actionlint to PATH
|
|
run: echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Run preflight
|
|
env:
|
|
GLOVE_PREPARE_LINUX_USERNS: ${{ runner.os == 'Linux' && '1' || '0' }}
|
|
run: scripts/preflight.sh
|