-
Notifications
You must be signed in to change notification settings - Fork 4
89 lines (76 loc) · 2.85 KB
/
test-linux.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
# modified from https://github.com/simonmichael/hledger/blob/master/.github/workflows/linux.yml
name: CI (Linux)
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v2
# things to be cached/restored:
- name: 💾 Cache stack global package db
id: stack-global
uses: actions/cache@v2
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-${{ matrix.plan.ghc }}
- name: 💾 Cache stack-installed programs in ~/.local/bin
id: stack-programs
uses: actions/cache@v2
with:
path: ~/.local/bin
key: ${{ runner.os }}-stack-programs-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-programs-${{ matrix.plan.ghc }}
- name: 💾 Cache .stack-work
uses: actions/cache@v2
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-work-${{ matrix.plan.ghc }}
# - name: 💾 Cache gcl/.stack-work
# uses: actions/cache@v2
# with:
# path: ./gcl/.stack-work
# key: ${{ runner.os }}-gcl-stack-work-${{ matrix.plan.ghc }}-${{ hashFiles('./gcl/package.yaml') }}
# restore-keys: |
# ${{ runner.os }}-gcl-stack-work-${{ matrix.plan.ghc }}
# actions:
- name: ⏬ Install stack
run: |
mkdir -p ~/.local/bin
export PATH=~/.local/bin:$PATH
# curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
stack --version
- name: ⏬ Install GHC
run: |
df -h
stack setup --install-ghc
df -h
- name: ⏬ Install haskell deps
run: |
stack build --only-dependencies
- name: 🔨 Build and run tests
run: |
stack test
# artifacts:
- name: 📦 Install & Gather executables
id: exes
run: |
stack install
cp ~/.local/bin/gcl .
zip -r gcl gcl
mv gcl.zip gcl-ubuntu.zip
- name: 🚢 Release Artifacts
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') # so that only commits with a git tag would upload artifacts
with:
files: gcl-ubuntu.zip
draft: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}