From 78d1e72924dc5c72e65b58ed993091e45c7be93a Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Mon, 20 Nov 2023 17:43:09 +0800 Subject: [PATCH] CI: stack is preinstalled on GHA runners --- .github/workflows/test-linux.yaml | 3 ++- .github/workflows/test-mac.yaml | 3 ++- .github/workflows/test-windows.yaml | 20 +++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-linux.yaml b/.github/workflows/test-linux.yaml index 919c014..f33de58 100644 --- a/.github/workflows/test-linux.yaml +++ b/.github/workflows/test-linux.yaml @@ -52,8 +52,9 @@ jobs: run: | mkdir -p ~/.local/bin export PATH=~/.local/bin:$PATH + ## Stack is preinstalled on the GHA runners # curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack - if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi + # if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi stack --version - name: ⏬ Install GHC diff --git a/.github/workflows/test-mac.yaml b/.github/workflows/test-mac.yaml index 5cd996c..7cb7f19 100644 --- a/.github/workflows/test-mac.yaml +++ b/.github/workflows/test-mac.yaml @@ -55,8 +55,9 @@ jobs: run: | mkdir -p ~/.local/bin export PATH=~/.local/bin:$PATH + ## Stack is preinstalled on the GHA runners # brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack - if [[ ! -x ~/.local/bin/stack ]]; then brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi + # if [[ ! -x ~/.local/bin/stack ]]; then brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi stack --version - name: ⏬ Install GHC diff --git a/.github/workflows/test-windows.yaml b/.github/workflows/test-windows.yaml index 2a0bcfe..0fbb4cf 100644 --- a/.github/workflows/test-windows.yaml +++ b/.github/workflows/test-windows.yaml @@ -50,39 +50,37 @@ jobs: # actions - name: ⏬ Install stack + ## Stack is preinstalled on GHA runners. + # #if: steps.stack-programs-dir.outputs.cache-hit != 'true' # this step is needed to get stack.exe into PATH, for now + # curl -sL https://get.haskellstack.org/stable/windows-x86_64.zip -o stack.zip + # 7z x stack.zip stack.exe run: | - curl -sL https://get.haskellstack.org/stable/windows-x86_64.zip -o stack.zip - 7z x stack.zip stack.exe which stack stack --version - which ./stack - ./stack --version - # must avoid GHC versions broken on windows such as 8.8.3 with https://gitlab.haskell.org/ghc/ghc/issues/17926 - # current default stack.yaml uses GHC 8.8.4 which hopefully is ok - name: ⏬ Install GHC # if: steps.stack-programs-dir.outputs.cache-hit != 'true' # set PATH=C:\Users\runneradmin\AppData\Local\Programs\stack\local\bin;%PATH% run: | - ./stack --no-terminal setup --install-ghc + stack --no-terminal setup --install-ghc - name: Install the icu library run: | - ./stack exec -- pacman -S --noconfirm mingw-w64-x86_64-icu mingw-w64-x86_64-pkgconf + stack exec -- pacman -S --noconfirm mingw-w64-x86_64-icu mingw-w64-x86_64-pkgconf - name: 📸 Build Snapshot run: | - ./stack build --no-terminal --only-snapshot -j1 + stack build --no-terminal --only-snapshot -j1 - name: 🧰 Build Dependencies run: | - ./stack build --no-terminal --only-dependencies + stack build --no-terminal --only-dependencies - name: 🔨 Build and run tests run: | - ./stack test + stack test # things to be cached