Switch to GTK3 #159
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - v* | |
| pull_request: | |
| release: | |
| env: | |
| GHC_FOR_RELEASE: "9.10" | |
| jobs: | |
| build: | |
| name: GHC ${{ matrix.ghc-version }} on ${{ matrix.os }} ${{matrix.container}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| ghc-version: ['9.12', '9.10', '9.8', '9.6', '9.4', '9.2'] | |
| container: [''] | |
| include: | |
| # The windows build is currently broken | |
| # See #135 | |
| #- os: windows-latest | |
| # ghc-version: '9.10' | |
| - os: macos-latest | |
| ghc-version: '9.10' | |
| # gtk2hs is broken under apline | |
| # See https://github.com/gtk2hs/gtk2hs/issues/262 | |
| #- os: ubuntu-latest | |
| # ghc-version: '9.10' | |
| # container: alpine:3.21 | |
| runs-on: ${{ matrix.os }} | |
| container: ${{ matrix.container }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies (Alpine) | |
| if: ${{ startsWith(matrix.container, 'alpine') }} | |
| shell: sh | |
| run: | | |
| apk add bash curl sudo jq pkgconfig \ | |
| zlib-dev zlib-static binutils curl \ | |
| gcc g++ gmp-dev libc-dev libffi-dev make \ | |
| musl-dev ncurses-dev perl tar xz \ | |
| gtk+3.0-dev | |
| - name: Install system dependencies (Ubuntu) | |
| if: runner.os == 'Linux' && !startsWith(matrix.container, 'alpine') | |
| run: sudo apt-get update && sudo apt-get install libgtk-3-dev | |
| - name: Install system dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install cairo gtk+3 pkg-config | |
| - name: Set extra cabal build options (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| printf 'package gtk\n flags: +have-quartz-gtk' >>cabal.project | |
| - name: Set up GHC ${{ matrix.ghc-version }} | |
| uses: haskell-actions/setup@v2 | |
| id: setup | |
| with: | |
| ghc-version: ${{ matrix.ghc-version }} | |
| - name: Enable static build (only on alpine) | |
| if: ${{ startsWith(matrix.container, 'alpine') }} | |
| run: | | |
| echo 'executable-static: true' >>cabal.project | |
| echo 'cc-options: -D_Noreturn=' >>cabal.project | |
| - name: Configure the build | |
| run: | | |
| cabal configure --enable-tests --enable-benchmarks --disable-documentation | |
| cabal build all --dry-run | |
| - name: Restore cached dependencies | |
| uses: actions/cache/restore@v4 | |
| id: cache | |
| env: | |
| key: ${{ runner.os }}${{ matrix.container && '-container-' }}${{matrix.container}}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }} | |
| with: | |
| path: ${{ steps.setup.outputs.cabal-store }} | |
| key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} | |
| restore-keys: ${{ env.key }}- | |
| - name: Install dependencies | |
| # If we had an exact cache hit, the dependencies will be up to date. | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: cabal build all --only-dependencies | |
| # Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail. | |
| - name: Save cached dependencies | |
| uses: actions/cache/save@v4 | |
| # If we had an exact cache hit, trying to save the cache would error because of key clash. | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| with: | |
| path: ${{ steps.setup.outputs.cabal-store }} | |
| key: ${{ steps.cache.outputs.cache-primary-key }} | |
| - name: Install system dependencies (Windows) | |
| if: ${{ startsWith(matrix.os, 'windows') }} | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| path-type: inherit | |
| install: >- | |
| mingw-w64-x86_64-pkg-config | |
| mingw-w64-x86_64-gtk2 | |
| - name: Build | |
| run: cabal build all | |
| - name: Run tests | |
| run: cabal test all | |
| - name: Check cabal file | |
| run: cabal check | |
| - name: Create bindist | |
| shell: sh | |
| run: | | |
| cabal install --install-method=copy --installdir=dist | |
| BINDIST_NAME="threadscope-ghc-${{matrix.ghc-version}}-${{ matrix.os }}${{ matrix.container && '-' }}${{matrix.container && 'alpine'}}" | |
| echo "BINDIST_NAME=$BINDIST_NAME" >> "$GITHUB_ENV" | |
| tar -czf "$BINDIST_NAME.tar.xz" -C dist threadscope | |
| echo bindist is "$BINDIST_NAME.tar.xz" | |
| - name: Upload bindist to artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ matrix.ghc-version == env.GHC_FOR_RELEASE }} | |
| with: | |
| name: ${{ env.BINDIST_NAME }} | |
| path: ${{ env.BINDIST_NAME}}.tar.xz | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.ghc-version == env.GHC_FOR_RELEASE }} | |
| with: | |
| files: ${{ env.BINDIST_NAME }}.tar.xz |