From b907d25fe43e2b7b9ecfe50c65b2d1f85c079d52 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 20 Jun 2020 09:00:13 +0200 Subject: 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. --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6742b0298..a94d42e7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 -- cgit v1.2.3