-
Notifications
You must be signed in to change notification settings - Fork 81
76 lines (75 loc) · 2.62 KB
/
patch-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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