Skip to content

Commit 0b9be77

Browse files
authored
[ actions ] move build & html doc deploy to actions (agda#1516)
1 parent c9a67ca commit 0b9be77

File tree

6 files changed

+119
-218
lines changed

6 files changed

+119
-218
lines changed

.github/workflows/ci-ubuntu.yml

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Ubuntu build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- experimental
7+
pull_request:
8+
branches:
9+
- master
10+
- experimental
11+
12+
## See 'Pick Agda version' for branch-specific commit selection
13+
env:
14+
GHC_VERSION: 8.6.5
15+
CABAL_VERSION: 3.2.0.0
16+
CABAL_INSTALL: cabal install --overwrite-policy=always --ghc-options='-O1 +RTS -M6G -RTS'
17+
AGDA: agda -Werror +RTS -M3.5G -H3.5G -A128M -RTS -i. -i src/
18+
19+
jobs:
20+
test-stdlib:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Initialise variables
24+
run: |
25+
if [[ '${{ github.ref }}' == 'refs/heads/master' \
26+
|| '${{ github.base_ref }}' == 'master' ]]; then
27+
# Pick Agda version for master
28+
echo "AGDA_COMMIT=tags/v2.6.1.3.20210524" >> $GITHUB_ENV;
29+
echo "AGDA_HTML_DIR=html" >> $GITHUB_ENV
30+
elif [[ '${{ github.ref }}' == 'refs/heads/experimental' \
31+
|| '${{ github.base_ref }}' == 'experimental' ]]; then
32+
# Pick Agda version for experimental
33+
echo "AGDA_COMMIT=tags/v2.6.1.3.20210524" >> $GITHUB_ENV;
34+
echo "AGDA_HTML_DIR=html/experimental" >> $GITHUB_ENV
35+
fi
36+
37+
if [[ '${{ github.ref }}' == 'refs/heads/master' \
38+
|| '${{ github.ref }}' == 'refs/heads/experimental' ]]; then
39+
echo "AGDA_DEPLOY=true" >> $GITHUB_ENV
40+
fi
41+
42+
- name: Cache cabal packages
43+
uses: actions/cache@v2
44+
id: cache-cabal
45+
with:
46+
path: |
47+
~/.cabal/packages
48+
~/.cabal/store
49+
~/.cabal/bin
50+
key: ${{ runner.os }}-${{ env.GHC_VERSION }}-${{ env.CABAL_VERSION }}-${{ env.AGDA_COMMIT }}
51+
52+
- name: Install cabal
53+
if: steps.cache-cabal.outputs.cache-hit != 'true'
54+
uses: actions/[email protected]
55+
with:
56+
ghc-version: ${{ env.GHC_VERSION }}
57+
cabal-version: ${{ env.CABAL_VERSION }}
58+
59+
- name: Put cabal programs in PATH
60+
run: echo "~/.cabal/bin" >> $GITHUB_PATH
61+
62+
- name: Cabal update
63+
run: cabal update
64+
65+
- name: Download and install Agda from github
66+
if: steps.cache-cabal.outputs.cache-hit != 'true'
67+
run: |
68+
git clone https://github.com/agda/agda
69+
cd agda
70+
git checkout ${{ env.AGDA_COMMIT }}
71+
mkdir -p doc
72+
touch doc/user-manual.pdf
73+
${{ env.CABAL_INSTALL }}
74+
cd ..
75+
76+
# Download and test stdlib
77+
- name: Checkout stdlib
78+
uses: actions/checkout@v2
79+
80+
- name: Test stdlib
81+
run: |
82+
${{ env.CABAL_INSTALL }} agda-stdlib-utils.cabal
83+
cabal run GenerateEverything
84+
cp travis/* .
85+
./index.sh
86+
${{ env.AGDA }} --safe EverythingSafe.agda
87+
${{ env.AGDA }} --html --html-dir ${{ env.AGDA_HTML_DIR }} index.agda
88+
89+
# This is a massive hack at the moment
90+
# - name: Compile stdlib
91+
# run: |
92+
# ${{ env.AGDA }} -c --no-main --ghc-dont-call-ghc --compile-dir=tmp Everything.agda
93+
# cd tmp
94+
# yes | cabal init --interactive
95+
# head -n -17 tmp.cabal > tmp
96+
# mv tmp tmp.cabal
97+
# cat ../travis/ghc-options >> tmp.cabal
98+
# cabal build
99+
100+
## ${{ env.AGDA }} -c README/Foreign/Haskell.agda && ./Haskell
101+
102+
103+
- name: Deploy
104+
uses: JamesIves/[email protected]
105+
if: ${{ success() && env.AGDA_DEPLOY }}
106+
107+
with:
108+
branch: gh-pages
109+
folder: html
110+
git-config-name: Github Actions

.github/workflows/haskell-ci.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@
1414
#
1515
name: Haskell-CI
1616
on:
17-
- push
18-
- pull_request
17+
push:
18+
branches:
19+
- master
20+
- experimental
21+
pull_request:
22+
branches:
23+
- master
24+
- experimental
1925
jobs:
2026
linux:
2127
name: Haskell-CI - Linux - ${{ matrix.compiler }}

.travis.yml

-199
This file was deleted.

travis/index.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# OPTIONS --rewriting #-}
1+
{-# OPTIONS --rewriting --sized-types --guardedness #-}
22

33
module index where
44

travis/index.sh

-10
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,5 @@ for file in $( find src -name "*.agda" | sort ); do
44
if [[ ! $( head -n 10 $file | grep -m 1 "This module is DEPRECATED" ) ]]; then
55
i=$( echo $file | sed 's/src\/\(.*\)\.agda/\1/' | sed 's/\//\./g' )
66
echo "import $i" >> index.agda;
7-
if [[ ! $i == *Unsafe \
8-
&& ! $i == Reflection \
9-
&& ! $i == IO* \
10-
&& ! $i == *TrustMe \
11-
&& ! $i == Debug* \
12-
&& ! $i == Codata.Musical* \
13-
&& ! $i == Foreign* \
14-
&& ! $i == System* \
15-
&& ! $i == Text.Pretty* \
16-
]]; then echo "import $i" >> safe.agda; fi
177
fi
188
done

travis/safe.agda

-6
This file was deleted.

0 commit comments

Comments
 (0)