-
Notifications
You must be signed in to change notification settings - Fork 48
136 lines (126 loc) · 4.11 KB
/
main.yml
File metadata and controls
136 lines (126 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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@8821f57b53846d35d62632eb51c60ac6c4bff4ce # v1.6.1
with:
compiler: intel
- name: Build C library
# 1. Force to only build the 64-bit version since ITT API 32-bit support will be discontinued soon
# 2. Disable PT support for MacOS since we have x86 specific assembly instructions
# 3. 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 --force_bits 64 -ft ${{ matrix.optional_args }}
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: Build C++ wrapper
run: python buildall.py --force_bits 64 -cpp
- name: Test (Linux)
run: ctest --test-dir build_linux/64/cpp --build-config Release --output-on-failure
if: runner.os == 'Linux'
- name: Test (Windows)
run: ctest --test-dir build_win/64/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