blob: 971fb02afb21a1fe380b3d73fafc9484e0610ca3 [file] [edit]
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
c_build:
name: Check upstream C library
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
optional_args: -pt
- os: windows-latest
optional_args: -pt --cmake_gen ninja
- os: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Fortran compiler
uses: fortran-lang/setup-fortran@2a1b9c55897d827a9dfeb114408f3615e53b2b72 # v1.9.0
with:
compiler: intel
- name: Setup MSVC environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: amd64
- name: Build C library
# - Disable PT support for MacOS since we have x86 specific assembly instructions
# - Switch to use Ninja CMake Generator for Windows since setup-fortran action
# doesn't work in case of CMake + VS (https://github.com/fortran-lang/setup-fortran/issues/45)
run: python buildall.py -ft ${{ matrix.optional_args }}
refcol_smoke:
name: Reference collector smoke test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
lib: build_linux/bin/libittnotify_refcol.so
exe: build_linux/bin/refcol_smoke_test
build_dir: build_linux
- os: windows-latest
lib: build_win/bin/libittnotify_refcol.dll
exe: build_win/bin/refcol_smoke_test.exe
build_dir: build_win
defaults:
run:
shell: bash
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup MSVC environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: amd64
- name: Build reference collector library
run: python buildall.py --refcol ${{ runner.os == 'Windows' && '--cmake_gen ninja' || '' }}
- name: Build smoke test
run: |
cmake ${{ matrix.build_dir }} -DITT_API_REFCOL_SMOKE_TESTS=ON
cmake --build ${{ matrix.build_dir }} --target refcol_smoke_test
- name: Run smoke test
run: python src/ittnotify_refcol/tests/run_smoke_test.py --lib ${{ matrix.lib }} --exe ${{ matrix.exe }}
cpp_wrapper:
name: Check C++ wrapper
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup MSVC environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: amd64
- name: Build C++ wrapper
run: python buildall.py -cpp ${{ runner.os == 'Windows' && '--cmake_gen ninja' || '' }}
- name: Test (Linux)
run: ctest --test-dir build_linux/cpp --build-config Release --output-on-failure
if: runner.os == 'Linux'
- name: Test (Windows)
run: ctest --test-dir build_win/cpp --build-config Release --output-on-failure
if: runner.os == 'Windows'
rust_format:
name: Check Rust formatting
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: rustup component add rustfmt clippy
- run: cargo fmt --all -- --check
- run: cargo clippy
rust_dependencies:
name: Check Rust dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: EmbarkStudios/cargo-deny-action@76cd80eb775d7bbbd2d80292136d74d39e1b4918 # v2.0.14
with:
manifest-path: rust/Cargo.toml
rust_build:
name: Check Rust crate
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: macos-latest
- os: windows-latest
- os: windows-latest
target: x86_64-pc-windows-gnu
defaults:
run:
working-directory: rust
shell: bash
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- run: rustup target add ${{ matrix.target }}
if: matrix.target != ''
- run: echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV
if: matrix.target != ''
- name: Build Rust crate
run: cargo build
- name: Test Rust crate
run: cargo test
- name: Check crates are publishable
# The Windows CI transforms the `c-library` symlink into a real directory, modifying the Git
# state, so we ignore these changes with `--allow-dirty` here.
run: scripts/verify-publish.sh --allow-dirty
python_build:
name: Check Python bindings
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: windows-latest
defaults:
run:
working-directory: python
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build and install ittapi package
run: python -m pip install .
- name: Run unit tests
run: python -m unittest discover -s utest -t utest