[automation] Add GHC version #153
Workflow file for this run
This file contains 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.bzl' | |
- '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@v3 | |
- id: set-ghc-versions | |
name: Extract from gen_ghc_bindist | |
run: python .github/extract_from_ghc_bindist.py | |
test-ghc-patches: | |
name: Test GHC patches | |
needs: find-ghc-version | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-11, 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@v3 | |
- name: Mount Bazel cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/repo-cache | |
key: repo-cache-${{ runner.os }}-bindist-${{ env.cache-version }} | |
- name: Install Bazel | |
shell: bash | |
run: | | |
BAZEL_DIR="$(.ci/fetch-bazel-bindist)" | |
mv $BAZEL_DIR $HOME/bazel | |
- 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=ci-macos-bindist;; | |
Linux) BUILD_CONFIG=ci-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 PATH=$HOME/bazel:$PATH | |
[[ ${{ runner.os }} == macOS ]] && export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 | |
export GHC_VERSION=${{ matrix.ghc-version }} | |
cd rules_haskell_tests | |
./tests/run-start-script.sh --use-bindists |