Skip to content

Commit

Permalink
[ ci ] first attempt at github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gallais committed Jun 15, 2021
1 parent 5fc0077 commit be7b41b
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/ci-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Ubuntu build
on:
push:
branches:
- master
pull_request:
branches:
- master

########################################################################
## CONFIGURATION
########################################################################

env:
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_COMMIT: 8eb0d01811a663cf2b27b482b3b18690adfa094b
STDLIB_VERSION: 1.6
AGDA: agda -Werror +RTS -M3.5G -H3.5G -A128M -RTS -i. -i src/

jobs:
test-categories:
runs-on: ubuntu-latest
steps:

- 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
# This caching step allows us to save a lot of building time by only
# downloading ghc and cabal and rebuilding Agda if absolutely necessary
- 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 }}

- name: Install ghc and cabal
if: steps.cache-cabal.outputs.cache-hit != 'true'
uses: actions/[email protected]
with:
ghc-version: ${{ env.GHC_VERSION }}
cabal-version: ${{ env.CABAL_VERSION }}

- name: Put cabal programs in PATH
run: echo "~/.cabal/bin" >> $GITHUB_PATH

- 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 -
- name: Checkout agda-categories
uses: actions/checkout@v2

- name: Test agda-categories
run: |
cp travis/* .
./everything.sh
${{ env.AGDA }} Everything.agda
${{ env.AGDA }} index.agda
# Note that if you want to deploy html for different versions like the
# standard library does, you will need to be a bit more subtle in this
# step.
- name: Generate HTML
run: |
${{ env.AGDA }} --html --html-dir html index.agda
- name: Deploy HTML
uses: JamesIves/[email protected]
if: ${{ success() && env.AGDA_DEPLOY }}

with:
branch: gh-pages
folder: html
7 changes: 7 additions & 0 deletions travis/everything.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#/bin/sh

find src/ -name '[^\.]*.agda' \
| sed -e 's|^src/[/]*|import |' -e 's|/|.|g' -e 's/.agda//' -e '/import Everything/d' \
| LC_COLLATE='C' sort \
> Everything.agda
cat Everything.agda >> index.agda

0 comments on commit be7b41b

Please sign in to comment.