-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (80 loc) · 2.44 KB
/
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Unit tests
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled'
required: false
default: false
env:
# Increase to reset cache manually
CACHE_NUMBER: 0
LIBNOMP_ENV: /usr/share/miniconda/envs/libnomp
INSTALLDIR: install
POCL_CACHE_NUMBER: 0
jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
compiler: [gcc-10, clang-15]
fail-fast: false
name: "${{ matrix.compiler }}"
env:
CC: ${{ matrix.compiler }}
steps:
- name: Setup GitHub actions
uses: actions/checkout@v3
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3.13
if: ${{ inputs.debug_enabled }}
- name: Setup conda environment
id: setup_conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: libnomp
use-mamba: false
- name: Cache conda environment
uses: actions/cache@v3
id: cache
with:
path: ${{ env.LIBNOMP_ENV }}
key: conda-${{ runner.os }}-${{ hashFiles('environment.yml') }}-${{ hashFiles('requirements.txt') }}-${{ env.CACHE_NUMBER }}
- name: Update conda environment
id: update_env
run: |
conda env update -n libnomp -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- uses: actions/cache@v3
id: pocl_cache
with:
path: ${{ env.LIBNOMP_ENV }}/lib/pocl
key: ${{ runner.os }}-build-pocl-${{ env.POCL_CACHE_NUMBER }}
- name: Install pocl
id: install_pocl
run: |
conda install -c conda-forge pocl
if: (steps.pocl_cache.outputs.cache-hit != 'true') || (steps.cache.outputs.cache-hit != 'true')
- name: Build libnomp
id: build_libnomp
run: |
./lncfg --cc ${CC} \
--install-prefix ${INSTALLDIR} \
--prefix-path ${CONDA_PREFIX} \
--enable-opencl --opencl-lib ${CONDA_PREFIX}/lib/libOpenCL.so
./lnbuild --install --update-shell
- name: Run libnomp tests
id: run_libnomp
run: |
${INSTALLDIR}/bin/lnrun test --backend opencl
- name: Block to allow inspecting failures
run: sleep 30m
if: ${{ failure() && inputs.debug_enabled }}