CI typing checks #119
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: read | |
checks: write | |
id-token: write | |
jobs: | |
build_and_test: | |
runs-on: ${{ matrix.runs-on }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows, linux, macos] | |
platform: [x86_64, aarch64] | |
compiler: [msvc, gcc, clang] | |
config: [Debug, Release] | |
python: ["3.10"] | |
exclude: | |
# Exclude macos (no runners available) | |
- { os: macos } | |
# Exclude aarch64 for windows/linux | |
- { os: windows, platform: aarch64 } | |
- { os: linux, platform: aarch64 } | |
# Exclude x86_64 for macos | |
- { os: macos, platform: x86_64 } | |
# Exclude unavailable compilers | |
- { os: windows, compiler: gcc } | |
- { os: windows, compiler: clang } | |
- { os: linux, compiler: msvc } | |
- { os: macos, compiler: msvc } | |
- { os: macos, compiler: gcc } | |
# Skip clang on linux | |
- { os: linux, compiler: clang } | |
include: | |
# Specify runners | |
- { os: windows, platform: x86_64, runs-on: [self-hosted, Windows, X64] } | |
- { os: linux, platform: x86_64, runs-on: [self-hosted, Linux, X64] } | |
# Enable header validation for one windows build | |
- { os: windows, compiler: msvc, config: Debug, flags: "header-validation" } | |
# Enable header validation and coverage for one linux build | |
- { os: linux, compiler: gcc, config: Debug, flags: "header-validation,coverage" } | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
# Environment variables used by ci.py | |
CI_OS: ${{ matrix.os }} | |
CI_PLATFORM: ${{ matrix.platform }} | |
CI_COMPILER: ${{ matrix.compiler }} | |
CI_CONFIG: ${{ matrix.config }} | |
CI_PYTHON: ${{ matrix.python }} | |
CI_FLAGS: ${{ matrix.flags }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
lfs: true | |
# Setup Python. | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'pip' | |
# Setup Python environment. | |
- name: Setup Python environment | |
run: | | |
python -m pip install -r tools/buildrequirements.txt | |
python -m pip install pytest-github-actions-annotate-failures | |
# Setup MSVC. | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
# Setup. | |
- name: Setup | |
run: python tools/ci.py setup | |
# sudo apt install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config | |
# Setup vcpkg caching. | |
- name: Export GitHub Actions cache environment variables | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
# Configure. | |
- name: Configure | |
run: python tools/ci.py configure | |
# Build. | |
- name: Build | |
run: python tools/ci.py build | |
# Typing Checks (Python) | |
- name: Typing Checks (Python) | |
run: python tools/ci.py typing-check-python | |
# Unit Tests (C++) | |
- name: Unit Tests (C++) | |
run: python tools/ci.py unit-test-cpp | |
# Unit Tests (Python) | |
- name: Unit Tests (Python) | |
run: python tools/ci.py unit-test-python | |
# Test Report | |
- name: Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: always() | |
with: | |
report_paths: 'reports/*-junit.xml' | |
check_name: "Unit Test Report" | |
# Generate Coverage Report | |
- name: Generate Coverage Report | |
if: contains(matrix.flags, 'coverage') | |
run: python tools/ci.py coverage-report | |
# Coverage Report | |
- name: Coverage Report | |
uses: actions/upload-artifact@v4 | |
if: contains(matrix.flags, 'coverage') | |
with: | |
name: coverage-report | |
path: reports/coverage.html |