Skip to content

Commit e9ba0d2

Browse files
authored
[ ci ] doc for the actions script (#1522)
I wrote some doc for agda/agda-categories#285 so we may as well have some in the stdlib repo too!
1 parent e926c7d commit e9ba0d2

File tree

1 file changed

+66
-2
lines changed

1 file changed

+66
-2
lines changed

.github/workflows/ci-ubuntu.yml

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,37 @@ on:
99
- master
1010
- experimental
1111

12-
## See 'Pick Agda version' for branch-specific commit selection
12+
########################################################################
13+
## CONFIGURATION
14+
##
15+
## See SETTINGS for the most important configuration variable: AGDA_COMMIT.
16+
## It has to be defined as a build step because it is potentially branch
17+
## dependent.
18+
##
19+
## As for the rest:
20+
##
21+
## Basically do not touch GHC_VERSION and CABAL_VERSION as long as
22+
## they aren't a problem in the build. If you have time to waste, it
23+
## could be worth investigating whether newer versions of ghc produce
24+
## more efficient Agda executable and could cut down the build time.
25+
## Just be aware that actions are flaky and small variations are to be
26+
## expected.
27+
##
28+
## The CABAL_INSTALL variable only passes `-O1` optimisations to ghc
29+
## because github actions cannot currently handle a build using `-O2`.
30+
## To be experimented with again in the future to see if things have
31+
## gotten better.
32+
##
33+
## The AGDA variable specifies the command to use to build the library.
34+
## It currently passes the flag `-Werror` to ensure maximal compliance
35+
## with e.g. not relying on deprecated definitions.
36+
## The rest are some arbitrary runtime arguments that shape the way Agda
37+
## allocates and garbage collects memory. It should make things faster.
38+
## Limits can be bumped if the builds start erroring with out of memory
39+
## errors.
40+
##
41+
########################################################################
42+
1343
env:
1444
GHC_VERSION: 8.6.5
1545
CABAL_VERSION: 3.2.0.0
@@ -20,6 +50,19 @@ jobs:
2050
test-stdlib:
2151
runs-on: ubuntu-latest
2252
steps:
53+
54+
########################################################################
55+
## SETTINGS
56+
##
57+
## AGDA_COMMIT picks the version of Agda to use to build the library.
58+
## It can either be a hash of a specific commit (to target a bugfix for
59+
## instance) or a tag e.g. tags/v2.6.1.3 (to target a released version).
60+
##
61+
## AGDA_HTML_DIR picks the html/ subdir in which to publish the docs.
62+
## The content of the html/ directory will be deployed so we put the
63+
## master version at the root and the experimental in a subdirectory.
64+
########################################################################
65+
2366
- name: Initialise variables
2467
run: |
2568
if [[ '${{ github.ref }}' == 'refs/heads/master' \
@@ -39,6 +82,15 @@ jobs:
3982
echo "AGDA_DEPLOY=true" >> $GITHUB_ENV
4083
fi
4184
85+
########################################################################
86+
## CACHING
87+
########################################################################
88+
89+
90+
# This caching step allows us to save a lot of building time by only
91+
# downloading ghc and cabal and rebuilding Agda if absolutely necessary
92+
# i.e. if we change either the version of Agda, ghc, or cabal that we want
93+
# to use for the build.
4294
- name: Cache cabal packages
4395
uses: actions/cache@v2
4496
id: cache-cabal
@@ -49,6 +101,10 @@ jobs:
49101
~/.cabal/bin
50102
key: ${{ runner.os }}-${{ env.GHC_VERSION }}-${{ env.CABAL_VERSION }}-${{ env.AGDA_COMMIT }}
51103

104+
########################################################################
105+
## INSTALLATION STEPS
106+
########################################################################
107+
52108
- name: Install cabal
53109
if: steps.cache-cabal.outputs.cache-hit != 'true'
54110
uses: actions/[email protected]
@@ -73,7 +129,11 @@ jobs:
73129
${{ env.CABAL_INSTALL }}
74130
cd ..
75131
76-
# Download and test stdlib
132+
########################################################################
133+
## TESTING AND DEPLOYMENT
134+
########################################################################
135+
136+
# By default github actions do not pull the repo
77137
- name: Checkout stdlib
78138
uses: actions/checkout@v2
79139

@@ -86,6 +146,10 @@ jobs:
86146
${{ env.AGDA }} --safe EverythingSafe.agda
87147
${{ env.AGDA }} index.agda
88148
149+
# We start by retrieving the currently deployed docs
150+
# We remove the content that is in the directory we are going to populate
151+
# so that stale files corresponding to deleted modules do not accumulate.
152+
# We then generate the docs in the AGDA_HTML_DIR subdirectory
89153
- name: Generate HTML
90154
run: |
91155
git clone --depth 1 --single-branch --branch gh-pages https://github.com/agda/agda-stdlib html

0 commit comments

Comments
 (0)