Improve CI to unpack into fresh directory #6
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: Build | |
on: | |
- push | |
- pull_request | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
main: | |
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
ghc: | |
- "9.2" | |
- "9.4" | |
- "9.6" | |
include: | |
- os: macOS-latest | |
ghc: "9.6" | |
- os: windows-latest | |
ghc: "9.6" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: haskell/actions/setup@v2 | |
id: setup-haskell-cabal | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: "latest" | |
cabal-update: true | |
- uses: actions/cache@v3 | |
name: Cache cabal stuff | |
with: | |
path: | | |
${{ steps.setup-haskell-cabal.outputs.cabal-store }} | |
dist-newstyle | |
key: ${{ runner.os }}-${{ matrix.ghc }} | |
- name: Cabal version | |
run: | | |
cabal --version | |
- name: Install doctest | |
run: | | |
mkdir -p "${{github.workspace}}/doctest-bin" | |
cabal install --install-method=symlink --installdir "${{github.workspace}}/doctest-bin" doctest | |
- name: Unpack | |
run: | | |
cabal sdist --ignore-project --output-directory .. | |
cd .. | |
cabal get prettyprinter-combinators-*.tar.gz | |
- name: Build | |
run: | | |
cd ../prettyprinter-combinators-*/ | |
cabal build all --enable-tests --enable-benchmarks | |
- name: Doctest | |
run: | | |
cd ../prettyprinter-combinators-*/ | |
cabal repl --with-ghc "${{github.workspace}}/doctest-bin/doctest" --repl-options=-Wno-missing-export-lists 'lib:prettyprinter-combinators' | |
- name: Haddock | |
run: | | |
cd ../prettyprinter-combinators-*/ | |
cabal haddock all | |
- name: Cabal check | |
run: | | |
cd ../prettyprinter-combinators-*/ | |
cabal check |