Merge of #2343 #418
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: Test patches | |
| on: | |
| push: | |
| paths: | |
| - 'haskell/ghc_bindist.bzl' | |
| - 'haskell/private/ghc_bindist_generated.json' | |
| - 'haskell/assets/**' | |
| workflow_dispatch: | |
| env: | |
| # Bump this number to invalidate the GH actions cache | |
| cache-version: 0 | |
| jobs: | |
| find-ghc-version: | |
| name: Find GHC versions for which a bindist is provided | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| ghc-matrix: ${{ steps.set-ghc-versions.outputs.ghc-matrix }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - id: set-ghc-versions | |
| name: Extract from gen_ghc_bindist | |
| run: python .github/extract_from_ghc_bindist.py | |
| test-ghc-patches: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.ghc-version }} | |
| cancel-in-progress: true | |
| name: Test GHC patches | |
| needs: find-ghc-version | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-24.04, macos-13, windows-2022] | |
| ghc-version: ${{ fromJSON(needs.find-ghc-version.outputs.ghc-matrix) }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Mount Bazel cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ~/repo-cache | |
| key: repo-cache-${{ runner.os }}-bindist-${{ env.cache-version }} | |
| - name: Configure | |
| env: | |
| BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }} | |
| shell: bash | |
| run: | | |
| # Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`. | |
| # See https://github.com/tweag/rules_haskell/issues/1498 and https://github.com/tweag/rules_haskell/pull/1692. | |
| [[ ${{ runner.os }} == Linux ]] && sudo sysctl -w net.ipv4.tcp_keepalive_time=60 | |
| case ${{ runner.os }} in | |
| macOS) BUILD_CONFIG=macos-bindist;; | |
| Linux) BUILD_CONFIG=linux-bindist;; | |
| Windows) BUILD_CONFIG=ci-windows-bindist;; | |
| esac | |
| cat >.bazelrc.local <<EOF | |
| common --config=ci | |
| build --config=$BUILD_CONFIG | |
| build --remote_header=x-buildbuddy-api-key="$BUILDBUDDY_API_KEY" | |
| EOF | |
| cat >~/.netrc <<EOF | |
| machine api.github.com | |
| password ${{ secrets.GITHUB_TOKEN }} | |
| EOF | |
| - uses: ./.github/actions/install_apt_pkgs | |
| with: | |
| # some old ghc distributions require libnuma, see https://gitlab.haskell.org/ghc/ghc/-/issues/15688 | |
| packages: libnuma-dev | |
| - name: Build & test | |
| shell: bash | |
| run: | | |
| export GHC_VERSION=${{ matrix.ghc-version }} | |
| cd rules_haskell_tests | |
| ./tests/run-start-script.sh --use-bindists |