-
Notifications
You must be signed in to change notification settings - Fork 49
55 lines (55 loc) · 2.21 KB
/
ci.yaml
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: CI
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
jobs:
build:
name: ${{ matrix.os }}-stack-${{ matrix.stackage }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
stackage: ['nightly', 'lts-21', 'lts-20']
steps:
- uses: actions/checkout@v4
- uses: haskell/actions/setup@v2
with:
enable-stack: true
stack-no-global: true
- name: Install packages
run: |
if [ ${{ matrix.os }} == "ubuntu-latest" ] ; then
sudo apt-get update -qq && sudo apt-get install -y gobjc++ libgnustep-base-dev libgsl-dev
else
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install gsl || true
fi
- uses: actions/cache@v3
with:
path: ~/.stack
key: stack-${{ matrix.os }}-${{ matrix.stackage }}-${{ hashFiles('stack.yaml') }}
- name: Build
run: |
if [ ${{ matrix.os }} == "ubuntu-latest" ] ; then
stack build --stack-yaml stack-${{ matrix.stackage }}.yaml --flag inline-c:gsl-example --flag inline-c-cpp:std-vector-example --flag inline-c-cuda:test-without-cuda
else
stack build --stack-yaml stack-${{ matrix.stackage }}.yaml --flag inline-c-cpp:std-vector-example --flag inline-c-cuda:test-without-cuda
fi
- name: Test
run: |
if [ ${{ matrix.os }} == "ubuntu-latest" ] ; then
stack test --stack-yaml stack-${{ matrix.stackage }}.yaml --flag inline-c:gsl-example --flag inline-c-cpp:std-vector-example --flag inline-c-cuda:test-without-cuda
./inline-c-cpp/test-error-message-line-numbers.sh --stack-yaml stack-${{ matrix.stackage }}.yaml
else
stack test --stack-yaml stack-${{ matrix.stackage }}.yaml --flag inline-c-cpp:std-vector-example --flag inline-c-cuda:test-without-cuda
./inline-c-cpp/test-error-message-line-numbers.sh --stack-yaml stack-${{ matrix.stackage }}.yaml
fi
env:
INLINE_C_CUDA_SUFFIX: cc
INLINE_C_CUDA_COMPILER: g++