diff --git a/.github/workflows/test-unix.yaml b/.github/workflows/test-unix.yaml index 5d101d0..67c9ef6 100644 --- a/.github/workflows/test-unix.yaml +++ b/.github/workflows/test-unix.yaml @@ -2,6 +2,10 @@ name: CI (Unix) +defaults: + run: + shell: bash + on: push: branches: [master, ci-*, ci] @@ -25,13 +29,26 @@ jobs: - name: ๐Ÿ— Install yq uses: frenck/action-setup-yq@v1 - - name: ๐Ÿ” Determine stack resolver & GHC + - name: ๐Ÿ” Determine Stack resolver & GHC version run: | - STACK_ROOT="$(stack path --stack-root)" STACK_RESOLVER=$(yq .resolver stack.yaml) GHC_VERSION=$(echo $(yq .compiler stack.yaml) | cut -c 5-) echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}" - echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}" + echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}" + + - name: ๐Ÿ— Setup Haskell + if : runner.os == 'macOS' + uses: haskell-actions/setup@v2 + id: setup-haskell + with: + ghc-version: ${{ env.GHC_VERSION }} + enable-stack: true + stack-version: 'latest' + + - name: ๐Ÿ” Determine Stack root + run: | + STACK_ROOT="$(stack path --stack-root)" + echo STACK_ROOT="${STACK_ROOT}" >> "${GITHUB_ENV}" # things to be restored: # Include STACK_RESOLVER in cache key, otherwise caches accumulate build products for different resolvers. @@ -60,13 +77,13 @@ jobs: run: | echo PKG_CONFIG_PATH="$(brew --prefix)/opt/icu4c/lib/pkgconfig" >> "${GITHUB_ENV}" - - name: โฌ Setup Haskell - uses: haskell-actions/setup@v2 - id: setup-haskell - with: - ghc-version: ${{ env.GHC_VERSION }} - enable-stack: true - stack-version: 'latest' + # - name: โฌ Setup Haskell + # uses: haskell-actions/setup@v2 + # id: setup-haskell + # with: + # ghc-version: ${{ env.GHC_VERSION }} + # enable-stack: true + # stack-version: 'latest' - name: ๐Ÿ”จ Build run: stack build diff --git a/.github/workflows/test-windows.yaml b/.github/workflows/test-windows.yaml index 77485c3..1637585 100644 --- a/.github/workflows/test-windows.yaml +++ b/.github/workflows/test-windows.yaml @@ -25,19 +25,26 @@ jobs: - name: ๐Ÿ— Install yq uses: frenck/action-setup-yq@v1 - - name: ๐Ÿ” Determine stack root and resolver and GHC + - name: ๐Ÿ” Determine Stack resolver & GHC version run: | - STACK_ROOT="$(stack path --stack-root)" STACK_RESOLVER=$(yq .resolver stack.yaml) GHC_VERSION=$(echo $(yq .compiler stack.yaml) | cut -c 5-) - echo STACK_ROOT="${STACK_ROOT}" >> "${GITHUB_ENV}" echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}" - echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}" - # run: | - # STACK_ROOT="$(stack --system-ghc --no-install-ghc path --stack-root || echo "C:/Users/runneradmin/AppData/Local/Programs/stack/x86_64-windows")" - # echo "STACK_ROOT = ${STACK_ROOT}" - # echo STACK_ROOT="${STACK_ROOT}" >> "${GITHUB_ENV}" - # What about C:/Users/runneradmin/AppData/Roaming/stack ? + echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}" + + - name: ๐Ÿ— Setup Haskell + if : runner.os == 'macOS' + uses: haskell-actions/setup@v2 + id: setup-haskell + with: + ghc-version: ${{ env.GHC_VERSION }} + enable-stack: true + stack-version: 'latest' + + - name: ๐Ÿ” Determine Stack root + run: | + STACK_ROOT="$(stack path --stack-root)" + echo STACK_ROOT="${STACK_ROOT}" >> "${GITHUB_ENV}" # things to be restored: # Include STACK_RESOLVER in cache key, otherwise caches accumulate build products for different resolvers. @@ -65,23 +72,23 @@ jobs: run: | 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 + - name: ๐Ÿ“ธ Build Snapshot + run: | + stack build --no-terminal --only-snapshot -j1 - # - name: ๐Ÿงฐ Build Dependencies - # run: | - # stack build --no-terminal --only-dependencies + - name: ๐Ÿงฐ Build Dependencies + run: | + stack build --no-terminal --only-dependencies - # - name: ๐Ÿ”จ Build and run tests - # run: | - # stack test + - name: ๐Ÿงช Run tests + run: | + stack test - - name: ๐Ÿ”จ Build - run: stack build + # - name: ๐Ÿ”จ Build + # run: stack build - - name: ๐Ÿงช Run tests - run: stack test + # - name: ๐Ÿงช Run tests + # run: stack test # things to be cached