Make build-dir configurable #159
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: ci | |
on: # yamllint disable-line rule:truthy rule:comments | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
cabal: | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: | |
- "9.10.1" | |
- "9.12.1" | |
os: | |
- "macos-latest" | |
- "ubuntu-latest" | |
- "windows-latest" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup haskell | |
uses: haskell-actions/setup@v2 | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 23.x | |
- name: Configure | |
run: cabal configure --enable-tests --ghc-options -Werror | |
- name: Build | |
run: cabal build exe:pacer | |
- name: Unit tests | |
id: unit | |
run: cabal test pacer:unit --test-options '--hedgehog-tests 1000000' | |
- name: Functional tests | |
id: functional | |
run: cabal test pacer:functional | |
- name: Generate charts html/hs | |
# TODO: It would be nice if we could test that the html page actually | |
# does what we want because it is possible for webpack to succeed yet | |
# the page is broken. | |
# | |
# It may be possible to require 0 console errors, though of course that | |
# could be overly restrictive. | |
run: | | |
cabal run pacer -- chart --data examples | |
# Let's test it overwrites successfully | |
cabal run pacer -- chart --data examples | |
stack: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- "macos-latest" | |
- "ubuntu-latest" | |
- "windows-latest" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup haskell | |
uses: haskell-actions/setup@v2 | |
with: | |
enable-stack: true | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 23.x | |
- name: Build | |
run: stack build --ghc-options -Werror | |
# yamllint disable rule:line-length | |
- name: Unit tests | |
id: unit | |
run: stack test pacer:test:unit --ghc-options -Werror --test-arguments '--hedgehog-tests 1000000' | |
# yamllint enable | |
- name: Functional tests | |
id: functional | |
run: stack test pacer:test:functional --ghc-options -Werror | |
- name: Generate charts html/hs | |
# TODO: It would be nice if we could test that the html page actually | |
# does what we want because it is possible for webpack to succeed yet | |
# the page is broken. | |
# | |
# It may be possible to require 0 console errors, though of course that | |
# could be overly restrictive. | |
run: | | |
stack run pacer -- chart --data examples | |
# Let's test it overwrites successfully | |
stack run pacer -- chart --data examples | |
nix: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- "macos-latest" | |
- "ubuntu-latest" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup nix | |
uses: cachix/install-nix-action@v30 | |
with: | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Compile & run tests | |
run: nix build -L | |
# Enter dev shell w/o npm. | |
# yamllint disable rule:line-length | |
- name: Test executable | |
run: nix develop --unset PATH .#ci -c bash -c ".github/scripts/nix_test.sh" | |
# yamllint enable | |
lint: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup nix | |
uses: cachix/install-nix-action@v30 | |
with: | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Formatting | |
run: | | |
nix run .#format | |
git diff --exit-code --color=always | |
- name: Lint | |
run: nix run .#lint | |
# TODO: Re-enable once hlint is working with ghc 9.10. | |
# | |
# Don't usually want this in CI, but we have this here to test that | |
# it actually runs. | |
# - name: Refactor | |
# run: nix run .#lint-refactor |