Skip to content

Update stacakge snapshot version #37

Update stacakge snapshot version

Update stacakge snapshot version #37

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
workflow_call:
outputs:
version:
value: ${{ jobs.build_prod.outputs.version }}
jobs:
stack_test:
strategy:
matrix:
stack_yaml:
- stack-ghc-9.0.yaml
- stack-ghc-9.2.yaml
- stack-ghc-9.4.yaml
- stack-ghc-9.6.yaml
# technically redundant, since this should be a symlink,
# but just to be extra sure
- stack.yaml
name: 'stack_test: ${{ matrix.stack_yaml }}'
runs-on: ubuntu-22.04
env:
STACK_YAML: ${{ matrix.stack_yaml }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ runner.os }}-stack_test-${{ matrix.stack_yaml }}-${{ hashFiles(matrix.stack_yaml, 'nvim-hs.cabal') }}
- run: stack test --test-arguments="--format=checks"
- name: Check that Cabal file was generated
run: git diff --exit-code '*.cabal'
cabal_test:
strategy:
matrix:
ghc_version:
- '9.2'
- '9.4'
- '9.6'
name: 'cabal_test: ghc-${{ matrix.ghc_version }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ConorMacBride/install-package@v1
with:
apt: neovim # for api generation
- uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc_version }}
- run: cabal update
- run: cabal freeze
- run: echo "CURR_MONTH=$(date +%B)" | tee -a "$GITHUB_ENV"
- uses: actions/cache@v3
with:
path: ~/.cabal/store
key: ${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ matrix.ghc_version }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ matrix.ghc_version }}-
- run: cabal install --overwrite-policy=always hspec-discover
- run: cabal test --test-show-details=streaming --test-options="--format=checks"
os_test:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
name: 'os_test: ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ runner.os }}-os_test-${{ hashFiles('stack.yaml', 'nvim-hs.cabal') }}
- run: stack test --fast
build_haddock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ runner.os }}-build_haddock-${{ hashFiles('stack.yaml', 'nvim-hs.cabal') }}
- name: Build haddock
# just a sanity check, so no need to build third-party docs
run: stack haddock --fast --no-haddock-deps
- name: Bundle haddock docs
run: tar czf nvim-hs-docs.tar.gz -C "$(find .stack-work/dist -regex '.*/doc/html/[^/]*')" .
- uses: actions/upload-artifact@v3
with:
name: nvim-hs-docs
path: nvim-hs-docs.tar.gz
check_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ runner.os }}-check_sdist-${{ hashFiles('stack.yaml') }}
- name: Create sdist bundle
run: stack sdist --test-tarball --tar-dir .
- uses: actions/upload-artifact@v3
with:
name: nvim-hs-sdist
path: nvim-hs-*.tar.gz