diff --git a/.github/workflows/stack.yml b/.github/workflows/stack.yml new file mode 100644 index 0000000..d9e0d7e --- /dev/null +++ b/.github/workflows/stack.yml @@ -0,0 +1,65 @@ +name: Stack build + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + name: Stack ${{ matrix.ghc }} ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + ghc: ['9.8', '9.6', '9.4', '9.2', '9.0', '8.10', '8.8', '8.6', '8.4', '8.2', '8.0'] + include: + - os: macos-latest + ghc: '9.8' + - os: windows-latest + ghc: '9.8' + + steps: + - uses: actions/checkout@v4 + + - uses: haskell-actions/setup@v2 + id: setup + with: + ghc-version: ${{ matrix.ghc }} + enable-stack: true + cabal-update: false + + - name: Restore cache + uses: actions/cache/restore@v4 + id: cache + env: + key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }} + with: + key: ${{ env.key }}-commit-${{ github.sha }} + restore-keys: ${{ env.key }}- + path: | + ${{ steps.setup.outputs.stack-root }} + .stack-work + + - name: Build dependencies + run: stack build --stack-yaml=stack-${{ matrix.ghc }}.yaml --system-ghc --only-dependencies + + - name: Build + run: stack build --stack-yaml=stack-${{ matrix.ghc }}.yaml --system-ghc + + - name: Build tests + run: stack test --stack-yaml=stack-${{ matrix.ghc }}.yaml --system-ghc --no-run-tests + + - name: Run tests + run: stack test --stack-yaml=stack-${{ matrix.ghc }}.yaml --system-ghc + + - name: Save cache + uses: actions/cache/save@v4 + if: always() && steps.cache.outputs.cache-hit != 'true' + with: + key: ${{ steps.cache.outputs.cache-primary-key }} + path: | + ${{ steps.setup.outputs.stack-root }} + .stack-work diff --git a/.gitignore b/.gitignore index 5ec7c3a..a0bc96a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /dist-newstyle/ -*.nix \ No newline at end of file +/.stack-work/ +*.nix +stack*.yaml.lock diff --git a/stack-8.0.yaml b/stack-8.0.yaml new file mode 100644 index 0000000..19d62b9 --- /dev/null +++ b/stack-8.0.yaml @@ -0,0 +1,10 @@ +resolver: lts-9.21 + +extra-deps: +- generic-data-0.3.0.0 +- base-orphans-0.8 +- show-combinators-0.1.0.0 + +allow-newer: true +allow-newer-deps: +- profunctors diff --git a/stack-8.10.yaml b/stack-8.10.yaml new file mode 100644 index 0000000..773d5c9 --- /dev/null +++ b/stack-8.10.yaml @@ -0,0 +1 @@ +resolver: lts-18.28 diff --git a/stack-8.2.yaml b/stack-8.2.yaml new file mode 100644 index 0000000..ec64270 --- /dev/null +++ b/stack-8.2.yaml @@ -0,0 +1,5 @@ +resolver: lts-11.22 + +extra-deps: +- generic-data-0.3.0.0 +- base-orphans-0.8 diff --git a/stack-8.4.yaml b/stack-8.4.yaml new file mode 100644 index 0000000..4ee5f2b --- /dev/null +++ b/stack-8.4.yaml @@ -0,0 +1,5 @@ +resolver: lts-12.26 + +extra-deps: +- generic-data-0.3.0.0 +- base-orphans-0.8 diff --git a/stack-8.6.yaml b/stack-8.6.yaml new file mode 100644 index 0000000..785b146 --- /dev/null +++ b/stack-8.6.yaml @@ -0,0 +1 @@ +resolver: lts-14.27 diff --git a/stack-8.8.yaml b/stack-8.8.yaml new file mode 100644 index 0000000..53095f7 --- /dev/null +++ b/stack-8.8.yaml @@ -0,0 +1 @@ +resolver: lts-16.31 diff --git a/stack-9.0.yaml b/stack-9.0.yaml new file mode 100644 index 0000000..f9994e6 --- /dev/null +++ b/stack-9.0.yaml @@ -0,0 +1 @@ +resolver: lts-19.33 diff --git a/stack-9.2.yaml b/stack-9.2.yaml new file mode 100644 index 0000000..fc9172f --- /dev/null +++ b/stack-9.2.yaml @@ -0,0 +1 @@ +resolver: lts-20.26 diff --git a/stack-9.4.yaml b/stack-9.4.yaml new file mode 100644 index 0000000..377040a --- /dev/null +++ b/stack-9.4.yaml @@ -0,0 +1 @@ +resolver: lts-21.25 diff --git a/stack-9.6.yaml b/stack-9.6.yaml new file mode 100644 index 0000000..1ffa6e2 --- /dev/null +++ b/stack-9.6.yaml @@ -0,0 +1 @@ +resolver: lts-22.20 diff --git a/stack-9.8.yaml b/stack-9.8.yaml new file mode 100644 index 0000000..07c4198 --- /dev/null +++ b/stack-9.8.yaml @@ -0,0 +1 @@ +resolver: nightly-2024-05-05