-
Notifications
You must be signed in to change notification settings - Fork 769
64 lines (60 loc) · 2.3 KB
/
github-ci.yml
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
# Copyright (C) 2021 Intel Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Build and Test
on:
# By default this will run when the activity type is "opened", "synchronize",
# or "reopened".
pull_request:
branches:
- master
# Manually run this workflow on any specified branch.
workflow_dispatch:
###################
# Define env vars #
###################
env:
INSTALL_PREFIX: $GITHUB_WORKSPACE
jobs:
library_build:
runs-on: '${{ matrix.os }}'
name: 'os=${{ matrix.os }} package_build=${{ matrix.package_build }} hexl=${{ matrix.hexl }} compiler=${{ matrix.cxx_compiler}}'
defaults:
run:
shell: bash
strategy:
matrix:
# TODO: shared builds
package_build: [ON, OFF]
hexl: [ON, OFF]
c_compiler: [gcc, clang]
os: [macos-13, ubuntu-22.04]
include: # Use g++ with gcc only and clang++ with clang only
- c_compiler: gcc
cxx_compiler: g++
- c_compiler: clang
cxx_compiler: clang++
exclude:
# Skip HEXL package build
- package_build: ON
hexl: ON
steps:
- uses: actions/checkout@v3
- run: |
set -x
env
./ci/install_deps.sh "${{ matrix.package_build }}" "${{ matrix.os }}" \
"${{ matrix.c_compiler }}" "${{ matrix.cxx_compiler }}" "${{ matrix.hexl }}"
./ci/build_install_lib.sh "${{ matrix.package_build }}" ${{ env.INSTALL_PREFIX }} \
${{ matrix.c_compiler }} ${{ matrix.cxx_compiler }} \
${{ matrix.hexl }} "./hexl/lib/cmake/hexl-1.2.4"
./ci/test_lib.sh
./ci/build_test_consumer.sh "examples" "${{ matrix.package_build }}" ${{ env.INSTALL_PREFIX }}
./ci/build_test_consumer.sh "utils" "${{ matrix.package_build }}" ${{ env.INSTALL_PREFIX }}