aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/CI.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/CI.yaml')
-rw-r--r--.github/workflows/CI.yaml90
1 files changed, 90 insertions, 0 deletions
diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml
new file mode 100644
index 0000000..84295c7
--- /dev/null
+++ b/.github/workflows/CI.yaml
@@ -0,0 +1,90 @@
+name: CI
+
+on: push
+
+jobs:
+
+ nix-build:
+ name: Nix build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2.3.4
+ - uses: cachix/install-nix-action@v13
+ with:
+ install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
+ install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
+ extra_nix_config: |
+ experimental-features = nix-command flakes
+ access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
+ - uses: cachix/cachix-action@v8
+ with:
+ name: jmc
+ authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+ - name: Build gsa-parser
+ run: nix build -L
+ # TODO `nix flake check` is currently system-dependent but should be used here
+ - name: Build gsa-parser checks
+ run: nix build -L '.#checks.x86_64-linux."gsa-parser:test:gsa-parser-test"'
+ - name: Build gsa-parser shell
+ run: nix build -L '.#devShell.x86_64-linux'
+
+ stack-build:
+ name: Stack ${{ matrix.resolver }} on ${{ matrix.os }} (${{ matrix.required }})
+ strategy:
+ fail-fast: false
+ matrix:
+ resolver: [ nightly, lts-18, lts-17, lts-16, lts-15, lts-14 ]
+ os: [ macos-latest, ubuntu-latest ]
+ required: [ required ]
+ # include:
+ # - resolver: nightly
+ # os: ubuntu-latest
+ # required: optional
+ continue-on-error: ${{ matrix.required == 'optional' }}
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v2
+ - uses: haskell/actions/setup@v1
+ with:
+ enable-stack: true
+ ## For some reason, stack caching seems to be very brittle, and cause a lot of build failures.
+ ## I haven't investigated very thoroughly what to best do about this, but for now, I'm just not caching stack builds.
+ # - uses: actions/cache@v2
+ # with:
+ # path: |
+ # ~/.stack
+ # .stack-work
+ # key: stack-cache-${{ matrix.os }}-${{ matrix.resolver }}-${{ hashFiles('**/*.cabal') }}
+ - run: stack init --resolver ${{ matrix.resolver }}
+ - run: stack build --resolver ${{ matrix.resolver }} --only-dependencies
+ - run: stack build --resolver ${{ matrix.resolver }}
+ - run: stack build --resolver ${{ matrix.resolver }} --haddock --test --bench --no-run-benchmarks
+
+ cabal-build:
+ name: Cabal GHC ${{ matrix.ghc }} on ${{ matrix.os }} (${{ matrix.required }})
+ strategy:
+ fail-fast: false
+ matrix:
+ ghc: [ '8.6.5', '8.8.3', '8.10.5', '9.0.1' ]
+ os: [ ubuntu-latest, macos-latest ]
+ required: [ required ]
+ include:
+ - ghc: latest
+ os: ubuntu-latest
+ required: optional
+ continue-on-error: ${{ matrix.required == 'optional' }}
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v2
+ - uses: haskell/actions/setup@v1
+ with:
+ ghc-version: ${{ matrix.ghc }}
+ - uses: actions/cache@v2
+ with:
+ path: |
+ ~/.cabal
+ dist-newstyle
+ key: cabal-cache-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal') }}
+ - run: cabal new-build --only-dependencies
+ - run: cabal new-build
+ - run: cabal new-test --test-show-details=direct