-
Notifications
You must be signed in to change notification settings - Fork 8
76 lines (68 loc) · 1.8 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build project
on: push
jobs:
build:
name: Build master with ${{ matrix.ghc }} / ${{ matrix.cabal }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ['9.2.8']
cabal: ['3.10']
os: ['ubuntu-20.04', 'ubuntu-22.04', 'macOS-latest']
steps:
- name: 'GitHub actions env workaround'
run: 'echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV'
# Setup
- name: Checkout repository
uses: actions/checkout@v1
# Haskell Setup
- name: Install GHC and Cabal
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Confirm GHC and Cabal installation
run: |
ghc --version
cabal --version
# Project Setup
- uses: actions/cache@v2
name: Cache dist-newstyle
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ matrix.os }}-${{ matrix.ghc }}-4-cabal
# Build
- name: Update package database
run: cabal update
- name: Display outdated packages
run: |
cd haskell-src
cabal outdated
- name: Install build dependencies
run: |
cd haskell-src
cabal build --only-dependencies
- name: Build
run: |
cd haskell-src
cabal build
# Upload artifacts
- name: Copy build artifact
run: |
cd haskell-src
cp `cabal list-bin exe:chainweb-data` ..
- name: Stripping binary
run: strip chainweb-data
- uses: actions/upload-artifact@v2
with:
name: chainweb-data-build-${{ matrix.os }}
path: chainweb-data
# Test
- name: Test
run: |
cd haskell-src
cabal v2-test