This repository has been archived by the owner on Aug 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
55 lines (53 loc) · 1.76 KB
/
build-test.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
name: Build and Test
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
# This step checks whether we should skip the job
# This prevents running duplicate jobs on merge and should
# cancel outdated builds on pull requests.
skip-check:
continue-on-error: true
runs-on: ubuntu-18.04
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: 'never'
skip_after_successful_duplicate: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
# Main job, builds the SDK and runs the tests for both multiple compilers
build-and-test:
needs: skip-check
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-18.04
strategy:
matrix:
include:
- compiler_package: "clang-6.0"
cc_compiler: "clang-6.0"
cxx_compiler: "clang++-6.0"
- compiler_package: "gcc g++"
cc_compiler: "gcc"
cxx_compiler: "g++"
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: |
sudo apt update
sudo apt install ${{matrix.compiler_package}} ocl-icd-opencl-dev opencl-headers ninja-build
bash .github/build_computecpp.sh
- name: Build SDK
run: |
mkdir build && cd build
cmake -GNinja ../ -DCMAKE_C_COMPILER=${{matrix.cc_compiler}} -DCMAKE_CXX_COMPILER=${{matrix.cxx_compiler}} -DComputeCpp_DIR=/tmp/computecpp -DCOMPUTECPP_SDK_BUILD_TESTS=1
ninja
- name: Run Tests
run: |
cd build
COMPUTECPP_TARGET="host" ctest -V