Skip to content

Commit

Permalink
Only run cabal-docspec on ubuntu-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabedini committed May 23, 2022
1 parent 1fc305f commit 7455f02
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,41 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
ghc: ['8.6', '8.8', '8.10', '9.0', '9.2']
steps:

- name: Checkout base repo
uses: actions/checkout@v2.3.5

- name: Set up Haskell
id: setup-haskell
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 'latest'
- run: echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: install cabal-docspec
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20211114/cabal-docspec-0.0.0.20211114.xz > cabal-docspec.xz
echo 'e224700d9e8c9ec7ec6bc3f542ba433cd9925a5d356676c62a9bd1f2c8be8f8a cabal-docspec.xz' | sha256sum -c -
xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
rm -f cabal-docspec.xz
chmod a+x $HOME/.cabal/bin/cabal-docspec
cabal-docspec --version

- name: Configure
run: cabal new-configure

- name: Freeze
run: cabal freeze

- name: Cache
uses: actions/cache@v2.1.3
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-

- name: Build
run: cabal build
- name: Docspec
run: cabal-docspec --extra-package containers

- name: Install and run cabal-docspec
if: matrix.os == 'ubuntu-latest'
working-directory: ${{ env.HOME }}
run: |
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20211114/cabal-docspec-0.0.0.20211114.xz > cabal-docspec.xz
echo 'e224700d9e8c9ec7ec6bc3f542ba433cd9925a5d356676c62a9bd1f2c8be8f8a cabal-docspec.xz' | sha256sum -c -
xz -d < cabal-docspec.xz > cabal-docspec
rm -f cabal-docspec.xz
chmod a+x cabal-docspec
./cabal-docspec --version
./cabal-docspec --builddir "${{ github.workspace }}/dist-newstyle" --extra-package containers

0 comments on commit 7455f02

Please sign in to comment.