Skip to content

Build

Build #1121

Workflow file for this run

# Code generated by dhall-to-yaml. DO NOT EDIT.
jobs:
build:
container: "ghcr.io/konn/computational-algebra/gha:0.7"
"continue-on-error": "${{matrix.isHead}}"
env:
STACK_YAML: "stack-${{matrix.ghc}}.yaml"
name: "Build ${{matrix.ghc}}"
"runs-on": "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- name: Cache ~/.stack
uses: "actions/cache@v2"
with:
key: "${{runner.os}}-build-global-stack-${{matrix.ghc}}-${{ hashFiles('**/package.yaml','**/*.cabal') }}-${{ hashFiles(format('{0}', env.STACK_YAML)) }}"
path: ~/.stack
"restore-keys": |
${{runner.os}}-build-global-stack-${{matrix.ghc}}-${{ hashFiles('**/package.yaml','**/*.cabal') }}-
${{runner.os}}-build-global-stack-${{matrix.ghc}}-
- name: "Cache **/.stack-work"
uses: "actions/cache@v2"
with:
key: "${{runner.os}}-build-local-stack-${{matrix.ghc}}-${{ hashFiles('**/package.yaml','**/*.cabal') }}-${{ hashFiles(format('{0}', env.STACK_YAML)) }}-${{ hashFiles('**/*.hs','**/*.lhs') }}"
path: "**/.stack-work"
"restore-keys": |
${{runner.os}}-build-local-stack-${{matrix.ghc}}-${{ hashFiles('**/package.yaml','**/*.cabal') }}-${{ hashFiles(format('{0}', env.STACK_YAML)) }}-
${{runner.os}}-build-local-stack-${{matrix.ghc}}-${{ hashFiles('**/package.yaml','**/*.cabal') }}-
${{runner.os}}-build-local-stack-${{matrix.ghc}}-
- name: Build
run: "stack build --test --no-run-tests --haddock --no-haddock-deps"
- name: Collect docs
run: "cp -r $(stack path --local-doc-root) docs/"
- name: Collect test exes
run: |
mkdir -p "test-bins/"
stack ide targets 2>&1 | grep :test: | while read i; do
PACK=$(echo "$i" | cut -d':' -f1);
EXE=$(echo "$i" | cut -d':' -f3);
cp "${PACK}/$(stack path --dist-dir)/build/${EXE}/${EXE}" "test-bins/";
done
- name: "Upload test-artifacts-${{ matrix.ghc }}"
uses: "actions/[email protected]"
with:
name: "test-artifacts-${{ matrix.ghc }}"
path: "test-bins/"
- name: "Upload doc-artifacts-${{matrix.ghc}}"
uses: "actions/[email protected]"
with:
name: "doc-artifacts-${{matrix.ghc}}"
path: docs/
strategy:
"fail-fast": false
matrix:
ghc:
- '8.10.7'
- '9.0.2'
include:
- ghc: '9.2.2'
isHead: true
isHead:
- false
"build-pages":
"continue-on-error": "${{matrix.isHead}}"
env: {}
name: "Build GitHub Pages for ${{matrix.ghc}}"
needs:
- build
- "build-site-generator"
"runs-on": "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
with:
ref: "gh-pages-devel"
- name: Cache _cache
uses: "actions/cache@v2"
with:
key: "${{runner.os}}-site-${{matrix.ghc}}-${{ hashFiles('index.md','stylesheets/**/*','templates/**/*','katex/**/*','javascripts/**/*','images/**/*') }}"
path: _cache
"restore-keys": "${{runner.os}}-site-${{matrix.ghc}}-"
- name: "Installs dependency (node)"
run: npm install jsdom
- id: docs
uses: "actions/download-artifact@v2"
with:
name: "doc-artifacts-${{matrix.ghc}}"
path: docs/
- name: Place document in correct place
run: |
if [ "${{steps.docs.outputs.download-path}}" != "$(pwd)/docs" ]; then
cp -r ${{steps.docs.outputs.download-path}} ./docs;
fi
- id: "site-bin"
name: Download site generator
uses: "actions/download-artifact@v2"
with:
name: "site-bin-artifact"
path: "site-bin"
- name: Locate bin
run: |
cp -r ${{steps.site-bin.outputs.download-path}}/site ./
chmod +x ./site
- name: Generate static site
run: ./site build
- name: "Upload pages-artifacts-${{matrix.ghc}}"
uses: "actions/[email protected]"
with:
name: "pages-artifacts-${{matrix.ghc}}"
path: _site/
strategy:
"fail-fast": false
matrix:
ghc:
- '8.10.7'
include: []
isHead:
- false
"build-site-generator":
name: Build Site Generator
"runs-on": "ubuntu-20.04"
steps:
- uses: "actions/checkout@v2"
with:
ref: "gh-pages-devel"
- name: Cache ~/.stack
uses: "actions/cache@v2"
with:
key: "document-global-stack-${{ hashFiles('package.yaml','**/*.cabal','stack.yaml') }}"
path: ~/.stack
"restore-keys": "document-global-stack-"
- name: "Cache **/.stack-work"
uses: "actions/cache@v2"
with:
key: "document-local-stack-${{ hashFiles('package.yaml','**/*.cabal','stack.yaml') }}-${{ hashFiles('**/*.hs') }}"
path: "**/.stack-work"
"restore-keys": |
document-local-stack-${{ hashFiles('package.yaml','**/*.cabal','stack.yaml') }}-
document-local-stack-
- uses: "haskell/actions/setup@v1"
with:
"enable-stack": 'true'
"ghc-version": '8.10.7'
"stack-version": '2.7.3'
- name: Build static site generator
run: "stack build --fast"
- name: Collect bins
run: |
mkdir -p "site-bin"
cp "$(stack path --dist-dir)/build/site/site" "site-bin"
- name: "Upload site-bin-artifact"
uses: "actions/[email protected]"
with:
name: "site-bin-artifact"
path: "site-bin"
test:
container: "ghcr.io/konn/computational-algebra/gha:0.7"
"continue-on-error": "${{matrix.isHead}}"
env:
STACK_YAML: "stack-${{matrix.ghc}}.yaml"
name: "Test ${{matrix.ghc}}"
needs:
- build
"runs-on": "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- id: "test-bins"
uses: "actions/download-artifact@v2"
with:
name: "test-artifacts-${{ matrix.ghc }}"
path: "test-bins/"
- name: Run all tests
run: |
ls "${{steps.test-bins.outputs.download-path}}"
stack ide targets 2>&1 | grep :test: | while read i; do
TEST_EXE=$(echo "$i" | cut -d':' -f3)
echo "Testing: ${TEST_EXE}"
chmod +x "${{steps.test-bins.outputs.download-path}}/${TEST_EXE}"
"${{steps.test-bins.outputs.download-path}}/${TEST_EXE}" +RTS -N
done
strategy:
"fail-fast": false
matrix:
ghc:
- '8.10.7'
- '9.0.2'
include:
- ghc: '9.2.2'
isHead: true
isHead:
- false
name: Build
'on':
pull_request: {}
push:
branches:
- master
schedule:
- cron: "00 13 * * *"