-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (90 loc) · 3.52 KB
/
build.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
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
on:
push:
branches:
- master
pull_request:
name: build
jobs:
build:
name: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- ghc: '8.6.5'
os: ubuntu-latest
stack_yaml: 'stack-ghc-8.6.yaml'
flags: ''
- ghc: '8.8.4'
os: ubuntu-latest
stack_yaml: 'stack-ghc-8.8.yaml'
flags: ''
- ghc: '8.10.7'
os: ubuntu-latest
stack_yaml: 'stack-ghc-8.10.yaml'
coveralls: true
flags: '--coverage'
- ghc: '9.0.2'
os: ubuntu-latest
stack_yaml: 'stack-ghc-9.0.yaml'
flags: ''
- ghc: '9.2.7'
os: ubuntu-latest
stack_yaml: 'stack-ghc-9.2.yaml'
flags: ''
- ghc: '9.4.5'
os: ubuntu-latest
stack_yaml: 'stack-ghc-9.4.yaml'
flags: ''
- ghc: '9.4.5'
os: macos-latest
stack_yaml: 'stack-ghc-9.4.yaml'
flags: ''
- ghc: '9.4.5'
os: windows-latest
stack_yaml: 'stack-ghc-9.4.yaml'
flags: ''
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup-haskell
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
enable-stack: true
stack-version: 'latest'
- name: Setup stack
run: stack config set system-ghc --global true
- uses: actions/cache@v4
name: Cache ~/.stack
with:
path: ${{ steps.setup-haskell.outputs.stack-root }}
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
- name: Install packages (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install liblbfgsb-dev
- name: Install packages (macOS)
if: runner.os == 'macOS'
run: brew install msakai/tap/liblbfgsb
- name: Add /opt/homebrew/lib as extra library directory
if: runner.os == 'macOS' && runner.arch == 'ARM64'
run: |
echo "extra-lib-dirs: [/opt/homebrew/lib]" >> ${{ matrix.stack_yaml }}
- name: Install packages (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
MINGW_PACKAGE_PREFIX=mingw-w64-x86_64
curl -o${MINGW_PACKAGE_PREFIX}-liblbfgsb-3.0-1-any.pkg.tar.zst -L https://github.com/msakai/mingw-w64-liblbfgsb/releases/download/v3.0-1/${MINGW_PACKAGE_PREFIX}-liblbfgsb-3.0-1-any.pkg.tar.zst
stack --stack-yaml ${{ matrix.stack_yaml }} exec -- pacman -Sy
stack --stack-yaml ${{ matrix.stack_yaml }} exec -- pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-lapack
stack --stack-yaml ${{ matrix.stack_yaml }} exec -- pacman -U --noconfirm ${MINGW_PACKAGE_PREFIX}-liblbfgsb-3.0-1-any.pkg.tar.zst
- name: Build dependencies
run: |
stack --stack-yaml ${{ matrix.stack_yaml }} build --test --no-run-tests --bench --no-run-benchmarks --only-dependencies --flag nonlinear-optimization-ad:BuildSamplePrograms --flag nonlinear-optimization-backprop:BuildSamplePrograms ${{ matrix.flags }}
- name: Build
run: |
stack --stack-yaml ${{ matrix.stack_yaml }} build --test --no-run-tests --bench --no-run-benchmarks --flag nonlinear-optimization-ad:BuildSamplePrograms --flag nonlinear-optimization-backprop:BuildSamplePrograms ${{ matrix.flags }}
- name: Create source tarball
run: stack --stack-yaml ${{ matrix.stack_yaml }} sdist