Bump actions/upload-artifact from 4 to 5 #710
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: ["master"] | |
| jobs: | |
| generate-matrix: | |
| name: "Generate matrix from cabal" | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Extract the tested GHC versions | |
| id: set-matrix | |
| uses: kleidukos/get-tested@v0.1.7.1 | |
| with: | |
| cabal-file: futr.cabal | |
| ubuntu-version: latest | |
| version: 0.1.7.1 | |
| linux-tests: | |
| name: ${{ matrix.ghc }} on ${{ matrix.os }} | |
| needs: generate-matrix | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} | |
| steps: | |
| - name: Checkout base repo | |
| uses: actions/checkout@v5 | |
| - name: Set up Haskell | |
| id: setup-haskell | |
| uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: ${{ matrix.ghc }} | |
| cabal-version: '3.10.3.0' | |
| - name: Cache Cabal packages | |
| uses: actions/cache@v4.3.0 | |
| with: | |
| path: | | |
| ~/.cabal/packages | |
| ~/.cabal/store | |
| dist-newstyle | |
| key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }} | |
| restore-keys: | | |
| ${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal- | |
| - name: Update Cabal package list | |
| run: cabal update | |
| - name: Install Build Tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y autoconf autogen automake libtool liblmdb-dev | |
| - name: Install Qt5 Dependencies | |
| run: | | |
| sudo apt-get install -y qtdeclarative5-dev qml-module-qtquick-controls2 libqt5quick5 qt5-image-formats-plugins qtmultimedia5-dev qml-module-qtmultimedia qttools5-dev-tools qtbase5-dev | |
| - name: Install secp256k1 Library | |
| run: | | |
| git clone https://github.com/bitcoin-core/secp256k1 && \ | |
| cd secp256k1 && \ | |
| git checkout v0.5.1 && \ | |
| ./autogen.sh && \ | |
| ./configure --enable-module-schnorrsig --enable-module-extrakeys --enable-module-ecdh --enable-experimental --enable-module-recovery && \ | |
| make && \ | |
| sudo make install && \ | |
| cd .. | |
| - name: Set Library Path | |
| run: echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/local.conf && sudo ldconfig | |
| - name: Configure | |
| run: cabal configure --enable-tests | |
| - name: Build | |
| run: cabal build all | |
| - name: Test | |
| run: cabal test | |
| windows-tests: | |
| name: Windows Tests | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout base repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Haskell | |
| uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: '9.6.7' | |
| cabal-version: '3.10.3.0' | |
| - name: Cache Cabal packages | |
| uses: actions/cache@v4.2.3 | |
| with: | |
| path: | | |
| ~/.cabal/packages | |
| ~/.cabal/store | |
| dist-newstyle | |
| key: ${{ runner.os }}-ghc-9.6.7-cabal-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }} | |
| restore-keys: | | |
| ${{ runner.os }}-ghc-9.6.7-cabal- | |
| - name: Cache MSYS2 pacman packages | |
| uses: actions/cache@v4.2.3 | |
| with: | |
| path: | | |
| C:\msys64\var\cache\pacman\pkg | |
| key: ${{ runner.os }}-pacman-pkg-v1 | |
| restore-keys: | | |
| ${{ runner.os }}-pacman-pkg- | |
| - name: Initialize Cabal user config | |
| run: cabal user-config init --force | |
| - name: Install MSYS2 packages (Qt5, toolchain) | |
| run: | | |
| C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm" | |
| C:\msys64\usr\bin\bash -lc "pacman -S --needed --noconfirm git mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-qt5-base mingw-w64-x86_64-qt5-declarative mingw-w64-x86_64-qt5-graphicaleffects mingw-w64-x86_64-qt5-imageformats mingw-w64-x86_64-qt5-multimedia mingw-w64-x86_64-qt5-quickcontrols2 mingw-w64-x86_64-qt5-svg mingw-w64-x86_64-qt5-tools mingw-w64-x86_64-qt5-translations mingw-w64-x86_64-qt5-winextras mingw-w64-x86_64-openssl mingw-w64-x86_64-angleproject mingw-w64-x86_64-lmdb mingw-w64-x86_64-libunwind mingw-w64-x86_64-toolchain mingw-w64-x86_64-zlib mingw-w64-x86_64-libwebp mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-giflib mingw-w64-x86_64-libwinpthread autoconf autogen automake libtool make" | |
| - name: Setup MSYS2 environment | |
| run: | | |
| C:\msys64\usr\bin\bash -lc "echo 'export PATH=/usr/bin:/mingw64/bin:/c/tools/ghc-9.6.7/bin:/c/ghcup/bin:$PATH' > ~/setup-env.sh" | |
| C:\msys64\usr\bin\bash -lc "echo 'export PKG_CONFIG_PATH=C:/msys64/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH' >> ~/setup-env.sh" | |
| - name: Clone HsQML | |
| run: C:\msys64\usr\bin\bash -lc "cd /d/a/futr && git clone https://github.com/prolic/HsQML" | |
| - name: Build secp256k1 | |
| run: | | |
| C:\msys64\usr\bin\bash -lc "source ~/setup-env.sh && git clone https://github.com/bitcoin-core/secp256k1 && cd secp256k1 && git checkout v0.5.1 && ./autogen.sh && ./configure --prefix=/mingw64 --enable-module-schnorrsig --enable-module-extrakeys --enable-module-ecdh --enable-experimental --enable-module-recovery && make && make install && cd .." | |
| - name: Build | |
| run: | | |
| C:\msys64\usr\bin\bash -lc "cd /d/a/futr/futr && source ~/setup-env.sh && cabal build --project-file=cabal.project.windows" | |
| - name: Test | |
| run: | | |
| C:\msys64\usr\bin\bash -lc "cd /d/a/futr/futr && source ~/setup-env.sh && cabal test --project-file=cabal.project.windows" |