-
Notifications
You must be signed in to change notification settings - Fork 8
118 lines (99 loc) · 3.77 KB
/
Copy pathci.yml
File metadata and controls
118 lines (99 loc) · 3.77 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
name: CI
# Trigger the workflow on push or pull request
on:
pull_request:
push:
# but only for the master branch
# branches: [master]
defaults:
run:
shell: bash
jobs:
stack:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} / llvm ${{ matrix.llvm }} / cuda ${{ matrix.cuda }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow_failure }}
strategy:
matrix:
include:
- os: ubuntu-latest
ghc: "8.10"
llvm: "9"
cuda: "10.2"
allow_failure: false
- os: ubuntu-latest
ghc: "8.8"
llvm: "9"
cuda: "10.2"
allow_failure: false
- os: ubuntu-latest
ghc: "8.6"
llvm: "8"
cuda: "10.1"
allow_failure: false
- os: macOS-latest
ghc: "8.8"
llvm: "9"
cuda: ""
allow_failure: false
# Disabled due to missing libffi
# - os: windows-latest
# ghc: "8.6"
# llvm: "9.0.1"
# cuda: "10.2.89.20191206"
# allow_failure: false
env:
STACK_FLAGS: "--system-ghc --no-install-ghc --fast"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-haskell@v1.1
with:
enable-stack: true
ghc-version: ${{ matrix.ghc }}
- name: Set up stack
id: stack-setup
run: |
ln -s stack-${{ matrix.ghc }}.yaml stack.yaml
echo "::set-output name=stack-root::$(stack path --system-ghc --no-install-ghc --stack-root)"
- uses: actions/cache@v1
with:
path: ${{ steps.stack-setup.outputs.stack-root }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.llvm }}-${{ matrix.cuda }}-stack
- name: Setup (Linux)
if: runner.os == 'Linux'
run: |
MATRIX_CUDA=${{ matrix.cuda }}
sudo apt-get -y install llvm-${{ matrix.llvm }}-dev libfftw3-dev
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
sudo apt-get update
sudo apt-get -y install cuda-${MATRIX_CUDA/./-}
echo "::set-env name=CUDA_HOME::/usr/local/cuda-${{ matrix.cuda }}"
echo "::set-env name=LD_LIBRARY_PATH::/usr/local/cuda-${{ matrix.cuda }}/lib64:$(stack exec ghc -- --print-libdir)/rts:/usr/local/cuda-${{ matrix.cuda }}/nvvm/lib64:${LD_LIBRARY_PATH}"
echo "::add-path::/usr/local/cuda-${{ matrix.cuda }}/bin"
- name: Setup (macOS)
if: runner.os == 'macOS'
run: |
brew tap llvm-hs/homebrew-llvm
brew install pkg-config
brew install libffi
brew install fftw
brew install llvm-${{ matrix.llvm }}
echo "::set-env name=PKG_CONFIG_PATH::$(brew --prefix)/opt/libffi/lib/pkgconfig:$PKG_CONFIG_PATH"
echo "::set-env name=STACK_FLAGS::$STACK_FLAGS --flag accelerate-fft:-llvm-ptx"
# - name: Setup (Windows)
# if: runner.os == 'Windows'
# run: |
# choco install llvm --version=${{ matrix.llvm }}
# choco install cuda --version=${{ matrix.cuda }}
- name: Build dependencies
run: |
stack build $STACK_FLAGS --test --no-run-tests --only-dependencies
- name: Build
run: |
stack build $STACK_FLAGS --test --no-run-tests
- name: Test
run: |
stack test accelerate-fft:test-llvm-native $STACK_FLAGS --test-arguments='--hedgehog-tests=50 --hedgehog-shrinks=0 --timeout=60s --num-threads=1'