Skip to content

Add Bazel 8 to Bazel CI build matrix #358

Add Bazel 8 to Bazel CI build matrix

Add Bazel 8 to Bazel CI build matrix #358

Workflow file for this run

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-latest
outputs:
ghc-matrix: ${{ steps.set-ghc-versions.outputs.ghc-matrix }}
steps:
- uses: actions/checkout@v4
- 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-latest, macos-13, windows-latest]
ghc-version: ${{ fromJSON(needs.find-ghc-version.outputs.ghc-matrix) }}
runs-on: ${{ matrix.os }}
steps:
- name: Install required packages
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -yy libtinfo5
sudo apt-get clean
if: ${{ matrix.os == 'ubuntu-latest' }}
- uses: actions/checkout@v4
- name: Mount Bazel cache
uses: actions/cache@v4
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
- name: Build & test
shell: bash
run: |
export GHC_VERSION=${{ matrix.ghc-version }}
cd rules_haskell_tests
./tests/run-start-script.sh --use-bindists