diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 42303cb..94cff15 100755 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,30 +11,97 @@ jobs: name: Stack runs-on: ${{ matrix.os }} strategy: - fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - resolver: - # Missing some packages now - #- "--resolver nightly" - - lts-18.16 # Win32 issue - - lts-16 - stack-yaml: - - stack.yaml - - stack-new-time.yaml - exclude: - - resolver: lts-16 - stack-yaml: stack-new-time.yaml - - os: windows-latest - stack-yaml: stack-new-time.yaml - + os: + - macos-latest + - ubuntu-latest + - windows-latest + versions: + #- + - 22.28 9.6.6 + - 21.25 9.4.8 + - 20.26 9.2.8 + - 19.33 9.0.2 + - 18.28 8.10.7 steps: + - name: Parse lts and ghc versions + shell: sh + run: | + echo snapshot=$(echo ${{ matrix.versions }} | cut -d ' ' -f 1) >> $GITHUB_ENV + echo ghcVersion=$(echo ${{ matrix.versions }} | cut -d ' ' -f 2) >> $GITHUB_ENV + - name: Install LLVM 13 + if: ${{ matrix.os == 'macos-latest' && env.snapshot < 20 }} + shell: sh + run: | + brew install llvm@13 + echo "/opt/homebrew/opt/llvm@13/bin" >> $GITHUB_PATH + echo extraLibDirs="--extra-lib-dirs /opt/homebrew/opt/llvm@13/lib" >> $GITHUB_ENV + echo extraIncludeDirsLLVM="--extra-include-dirs /opt/homebrew/opt/llvm@13/include" >> $GITHUB_ENV + echo extraIncludeDirsFFI="--extra-include-dirs /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ffi" >> $GITHUB_ENV + - name: Setup Haskell + id: setup-haskell-stack + uses: haskell-actions/setup@v2.7 + with: + ghc-version: ${{ env.ghcVersion }} + enable-stack: true + stack-version: 'latest' + cabal-update: false - name: Clone project - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Use Cache + uses: actions/cache@v4 + with: + key: ${{ matrix.os }}_${{ env.snapshot }}_${{ github.head_ref }} + restore-keys: | + ${{ matrix.os }}_${{ env.snapshot }}_${{ github.head_ref }} + ${{ matrix.os }}_${{ env.snapshot }}_${{ github.base_ref }} + ${{ matrix.os }}_${{ env.snapshot }}_ + ${{ matrix.os }}_${{ env.snapshot }} + path: | + ${{ steps.setup-haskell-stack.outputs.stack-root }} + .stack-work + */.stack-work + - name: Build and run tests + shell: bash + run: | + set -ex + ghc --version + stack --version + stack test --system-ghc $extraLibDirs $extraIncludeDirsLLVM $extraIncludeDirsFFI --fast --no-terminal --snapshot=lts-$snapshot + Cabal: + name: Cabal + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - macos-latest + - macos-13 + - ubuntu-latest + - windows-latest + steps: + - name: Setup Haskell + id: setup-haskell-cabal + uses: haskell-actions/setup@v2.7 + with: + ghc-version: 9.6.6 + - name: Clone project + uses: actions/checkout@v4 + - name: Use Cache + uses: actions/cache@v4 + with: + key: ${{ matrix.os }}_cabal_${{ github.head_ref }} + restore-keys: | + ${{ matrix.os }}_cabal_${{ github.head_ref }} + ${{ matrix.os }}_cabal_${{ github.base_ref }} + ${{ matrix.os }}_cabal_ + ${{ matrix.os }}_cabal + path: | + ${{ steps.setup-haskell-cabal.outputs.cabal-store }} + dist-newstyle - name: Build and run tests shell: bash run: | - set -ex - stack --version - stack test --fast --no-terminal --stack-yaml=${{ matrix.stack-yaml }} --resolver=${{ matrix.resolver }} + ghc --version + cabal --version + cabal test --minimize-conflict-set -O0 all diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..00dfed3 --- /dev/null +++ b/cabal.project @@ -0,0 +1,2 @@ +packages: + */*.cabal diff --git a/classy-prelude-conduit/classy-prelude-conduit.cabal b/classy-prelude-conduit/classy-prelude-conduit.cabal index 7e3ecc7..2ac82d0 100644 --- a/classy-prelude-conduit/classy-prelude-conduit.cabal +++ b/classy-prelude-conduit/classy-prelude-conduit.cabal @@ -50,6 +50,8 @@ test-suite spec Paths_classy_prelude_conduit hs-source-dirs: test + build-tool-depends: + hspec-discover:hspec-discover build-depends: QuickCheck , base >=4.13 && <5 diff --git a/classy-prelude-conduit/package.yaml b/classy-prelude-conduit/package.yaml index 550d6ed..1a676aa 100644 --- a/classy-prelude-conduit/package.yaml +++ b/classy-prelude-conduit/package.yaml @@ -38,3 +38,4 @@ tests: - classy-prelude-conduit - QuickCheck - conduit + build-tools: hspec-discover diff --git a/classy-prelude/classy-prelude.cabal b/classy-prelude/classy-prelude.cabal index 925ea9d..b727fe4 100644 --- a/classy-prelude/classy-prelude.cabal +++ b/classy-prelude/classy-prelude.cabal @@ -69,6 +69,8 @@ test-suite test hs-source-dirs: test ghc-options: -Wall + build-tool-depends: + hspec-discover:hspec-discover build-depends: QuickCheck , base >=4.13 && <5 diff --git a/classy-prelude/package.yaml b/classy-prelude/package.yaml index dd33b8d..a0133c9 100644 --- a/classy-prelude/package.yaml +++ b/classy-prelude/package.yaml @@ -64,3 +64,4 @@ tests: - hspec >=1.3 - QuickCheck - containers + build-tools: hspec-discover diff --git a/mono-traversable/mono-traversable.cabal b/mono-traversable/mono-traversable.cabal index 1baf9a9..c8cad75 100644 --- a/mono-traversable/mono-traversable.cabal +++ b/mono-traversable/mono-traversable.cabal @@ -57,6 +57,8 @@ test-suite test hs-source-dirs: test ghc-options: -O0 + build-tool-depends: + hspec-discover:hspec-discover build-depends: HUnit , QuickCheck diff --git a/mono-traversable/package.yaml b/mono-traversable/package.yaml index 8ecade0..bae7fac 100644 --- a/mono-traversable/package.yaml +++ b/mono-traversable/package.yaml @@ -44,6 +44,7 @@ tests: - containers - unordered-containers - foldl + build-tools: hspec-discover benchmarks: all: main: main.hs diff --git a/mutable-containers/mutable-containers.cabal b/mutable-containers/mutable-containers.cabal index 63b08d6..ce4f5ae 100644 --- a/mutable-containers/mutable-containers.cabal +++ b/mutable-containers/mutable-containers.cabal @@ -55,6 +55,8 @@ test-suite test Paths_mutable_containers hs-source-dirs: test + build-tool-depends: + hspec-discover:hspec-discover build-depends: QuickCheck , base >=4.13 && <5 diff --git a/mutable-containers/package.yaml b/mutable-containers/package.yaml index c04e41c..c007e8c 100644 --- a/mutable-containers/package.yaml +++ b/mutable-containers/package.yaml @@ -35,6 +35,7 @@ tests: - hspec - QuickCheck - primitive + build-tools: hspec-discover benchmarks: deque: main: deque.hs