-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.yml
More file actions
105 lines (92 loc) · 3.52 KB
/
main.yml
File metadata and controls
105 lines (92 loc) · 3.52 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
name: Ubuntu build
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
AGDA_COMMIT: tags/v2.6.2
STDLIB_VERSION: 1.7
GHC_VERSION: 8.6.5
CABAL_VERSION: 3.2.0.0
CABAL_INSTALL: cabal install --overwrite-policy=always --ghc-options='-O1 +RTS -M6G -RTS'
AGDA: agda --auto-inline -Werror +RTS -M6G -H3.5G -A128M -RTS -i. -i src/
jobs:
test-algebra:
runs-on: ubuntu-latest
steps:
########################################################################
## SETTINGS
########################################################################
- name: Initialise variables
run: |
# Only deploy if the build follows from pushing to master
if [[ '${{ github.ref }}' == 'refs/heads/master' ]]; then
echo "AGDA_DEPLOY=true" >> $GITHUB_ENV
fi
# The script won't be able to find Agda if we don't tell it to look at the
# content of ~/.cabal/bin
- name: Put cabal programs in PATH
run: echo "~/.cabal/bin" >> $GITHUB_PATH
########################################################################
## CACHING
########################################################################
# This caching step allows us to save a lot of building time by only
# downloading ghc and cabal and rebuilding Agda if absolutely necessary
# i.e. if we change either the version of Agda, ghc, or cabal that we want
# to use for the build.
- name: Cache cabal packages
uses: actions/cache@v2
id: cache-cabal
with:
path: |
~/.cabal/packages
~/.cabal/store
~/.cabal/bin
key: ${{ runner.os }}-${{ env.GHC_VERSION }}-${{ env.CABAL_VERSION }}-${{ env.AGDA_COMMIT }}
########################################################################
## INSTALLATION STEPS
########################################################################
- name: Install ghc and cabal
if: steps.cache-cabal.outputs.cache-hit != 'true'
uses: actions/setup-haskell@v1.1.3
with:
ghc-version: ${{ env.GHC_VERSION }}
cabal-version: ${{ env.CABAL_VERSION }}
- name: Cabal update
if: steps.cache-cabal.outputs.cache-hit != 'true'
run: cabal update
- name: Download and install Agda from github
if: steps.cache-cabal.outputs.cache-hit != 'true'
run: |
git clone https://github.com/agda/agda
cd agda
git checkout ${{ env.AGDA_COMMIT }}
mkdir -p doc
touch doc/user-manual.pdf
${{ env.CABAL_INSTALL }}
cd ..
- name: Install stdlib
run: |
mkdir -p $HOME/.agda
cd $HOME/.agda
wget https://github.com/agda/agda-stdlib/archive/v${{ env.STDLIB_VERSION }}.tar.gz
tar -xzvf v${{ env.STDLIB_VERSION }}.tar.gz
mv agda-stdlib-${{ env.STDLIB_VERSION }} agda-stdlib
echo "~/.agda/agda-stdlib/standard-library.agda-lib" > libraries
cd -
########################################################################
## TESTING AND DEPLOYMENT
########################################################################
# By default github actions do not pull the repo
- name: Checkout Agda-Algebra
uses: actions/checkout@v2
# Generate a fresh Everything.agda & index.agda and start building!
- name: Test agda-algebra
run: |
cp travis/* .
./everything.sh
${{ env.AGDA }} Everything.agda
${{ env.AGDA }} index.agda