Skip to content

clean up parser code and a lot of other stuff #36

clean up parser code and a lot of other stuff

clean up parser code and a lot of other stuff #36

Workflow file for this run

name: CI
on:
pull_request:
branches: [ "master" ]
push:
branches: [ "master" ]
tags: [ "*.*.*" ]
jobs:
runhaskell:
name: πŸ›  Build & Test
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout repository
uses: actions/checkout@v3
- name: 🧰 Setup Haskell & Stack
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-no-global: true
stack-version: 'latest'
- name: πŸ’Ύ Cache Stack
id: cache
uses: actions/cache@v3
with:
path: |
~/.stack
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}
- name: πŸ“Έ Build Snapshot
if: steps.cache.outputs.cache-hit != 'true'
run: |
stack --no-terminal test --bench --only-snapshot
- name: πŸ”¨ Build & Test
run: |
stack --no-terminal test --bench --haddock --no-haddock-deps --no-run-benchmarks --coverage
mkdir -p dist/haddock && mv $(stack path --local-install-root)/doc/* dist/haddock
sed -i 's@href="[^"]*/doc/\([^"]*.html\)"@href="\1"@g' dist/haddock/index.html
- name: 🎚 Coverage
run: |
stack hpc report --all --destdir dist/coverage 2>&1 | tee coverage.log
coverage=$(cat coverage.log | tr '\n' ' ' | sed "s/.* \([0-9]\+\)% top-level declarations used.*/\1/")
color="$(if [[ ${coverage} -ge '80' ]]; then echo 'green'; elif [[ $coverage -ge '60' ]]; then echo 'yellow'; else echo 'red'; fi)"
wget -O dist/coverage/badge.svg "https://img.shields.io/badge/coverage-${coverage}%25-${color}"
- name: πŸ“˜ Publish Documentation
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist
enable_jekyll: true