Skip to content

[ ci ]

[ ci ] #7

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, dev, ci ]
pull_request:
branches: [ master, dev, ci ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-and-test:
# Runs on all major platforms
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
agda: ["lts-20.26 Agda-2.6.4"]
ghc: ["ghc-9.2.8"]
fail-fast: false
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: πŸ“₯ Checkout repository
uses: actions/checkout@v4
# actions:
- name: ⏬ Setup Haskell environment
id: haskell-setup
uses: haskell-actions/setup@v2
with:
ghc-version: '9.2.8'
stack-version: latest
cabal-update: false
enable-stack: true
- name: Environment settings based on the Haskell setup
run: |
echo "runner.os = ${{ runner.os }}"
echo "OSTYPE = ${{ env.OSTYPE }}"
echo "ghc-path = ${{ steps.haskell-setup.outputs.ghc-path }}"
echo "ghc-exe = ${{ steps.haskell-setup.outputs.ghc-exe }}"
echo "stack-path = ${{ steps.haskell-setup.outputs.stack-path }}"
echo "stack-exe = ${{ steps.haskell-setup.outputs.stack-exe }}"
echo "stack-root = ${{ steps.haskell-setup.outputs.stack-root }}"
echo "STACK_LOCAL_BIN=$(stack path --local-bin)" >> "${GITHUB_ENV}"
echo "STACK_ROOT (orig) = ${{ env.STACK_ROOT }}"
echo "STACK_ROOT=${{ steps.haskell-setup.outputs.stack-root }}" >> "${GITHUB_ENV}"
echo "STACK_VER=$(stack --numeric-version)" >> "${GITHUB_ENV}"
GHC_VER=$(ghc --numeric-version)
echo "GHC_VER=${GHC_VER}" >> "${GITHUB_ENV}"
echo "ARGS=--stack-yaml=stack-${GHC_VER}.yaml --system-ghc --no-terminal" >> "${GITHUB_ENV}"
# cached stuff to be restored:
- name: πŸ’Ύ Restore cached stack global package db
id: stack-global
uses: actions/cache/restore@v4
with:
path: ${{ steps.haskell-setup.outputs.stack-root }}
key: ${{ runner.os }}-stack-global-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global
- name: πŸ’Ύ Restore stack-installed binaries in ~/.local/bin
id: stack-binaries
uses: actions/cache/restore@v4
with:
path: ${{ env.STACK_LOCAL_BIN }}
key: ${{ runner.os }}-stack-binaries-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-binaries
- name: πŸ’Ύ Restore cached .stack-work
id: stack-work
uses: actions/cache/restore@v4
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-work
- name: ⏬ Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20.x
# - name: πŸ”
# - name: ⏬ Install GHC
# # if: steps.stack-programs-dir.outputs.cache-hit != 'true'
# # set PATH=C:\Users\runneradmin\AppData\Local\Programs\stack\local\bin;%PATH%
# run: |
# stack --no-terminal setup --install-ghc
# - name: ⏬ Install the ICU library (Windows)
# if : runner.os == 'Windows'
# run: |
# stack exec -- pacman -S --noconfirm mingw-w64-x86_64-icu mingw-w64-x86_64-pkgconf
# stack exec -- pkg-config --modversion icu-i18n
- name: πŸ› οΈ Add Stack install directory to PATH (Windows)
if : runner.os == 'Windows'
run: |
echo "$APPDATA/local/bin" >> $GITHUB_PATH
- name: πŸ› οΈ Add Stack install directory to PATH (Unix)
if : runner.os != 'Windows'
run: PATH=$(stack path --local-bin):$PATH
- name: ⏬ Install Agda
run: |
stack install --resolver ${{ matrix.agda }}
which agda
# agda --version
# things to be cached
- name: πŸ’Ύ Cache stack global package db
if: always() && steps.stack-global.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ steps.haskell-setup.outputs.stack-root }}
key: ${{ steps.stack-global.outputs.cache-primary-key }}
- name: πŸ’Ύ Cache stack-installed binaries
if: always() && steps.stack-binaries.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ env.STACK_LOCAL_BIN }}
key: ${{ steps.stack-binaries.outputs.cache-primary-key }}
- name: πŸ’Ύ Cache .stack-work
if: always() && steps.stack-work.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: .stack-work
key: ${{ steps.stack-work.outputs.cache-primary-key }}
- name: ⏬ Install NPM Dependencies
run: npm install
- name: πŸ”¨ Build stuff
run: npm run build
- name: πŸš— Run tests (Linux)
if: runner.os == 'Linux'
run: xvfb-run -a npm test
- name: πŸš— Run tests (Windows, MacOS)
if: runner.os != 'Linux'
run: npm test