CI: use GitHub workflow command to set system path
This way, the PATH environment variable does not have to be set repeatedly in each step.
This commit is contained in:
parent
112e98def6
commit
b907d25fe4
1 changed files with 3 additions and 2 deletions
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
|
@ -68,6 +68,9 @@ jobs:
|
|||
sudo apt-get update
|
||||
sudo apt-get install ghc-${{ matrix.versions.ghc }} cabal-install-${{ matrix.versions.cabal }}
|
||||
fi
|
||||
# Use a GitHub workflow command to add folders to PATH.
|
||||
echo "::add-path::/opt/ghc/${{ matrix.versions.ghc }}/bin"
|
||||
echo "::add-path::/opt/cabal/${{ matrix.versions.cabal }}/bin"
|
||||
|
||||
# declare/restore cached things
|
||||
# caching doesn't work for scheduled runs yet
|
||||
|
@ -89,12 +92,10 @@ jobs:
|
|||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
export PATH=/opt/cabal/${{ matrix.versions.cabal }}/bin:/opt/ghc/${{ matrix.versions.ghc }}/bin:$PATH
|
||||
cabal v2-update
|
||||
cabal v2-build --dependencies-only --enable-tests --disable-optimization
|
||||
- name: Build and test
|
||||
run: |
|
||||
export PATH=/opt/cabal/${{ matrix.versions.cabal }}/bin:/opt/ghc/${{ matrix.versions.ghc }}/bin:$PATH
|
||||
cabal v2-build --enable-tests --disable-optimization 2>&1 | tee build.log
|
||||
# fail if warnings in local build
|
||||
! grep -q ": *[Ww]arning:" build.log || exit 1
|
||||
|
|
Loading…
Add table
Reference in a new issue