Skip to content

Commit 6434663

Browse files
github workflows
1 parent 269b89c commit 6434663

File tree

5 files changed

+159
-0
lines changed

5 files changed

+159
-0
lines changed

.github/workflows/build.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Haskell CI
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
merge_group:
10+
push:
11+
branches:
12+
- main
13+
- "release/*"
14+
15+
jobs:
16+
build:
17+
runs-on: ${{ matrix.os }}
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
ghc: ["9.6", "9.12"]
23+
os: [windows-latest]
24+
25+
env:
26+
# Modify this value to "invalidate" all cabal caches.
27+
CABAL_CACHE_VERSION: "2024-05-22"
28+
# Modify this value to "invalidate" the cabal store cache only.
29+
CACHE_VERSION: "20220919"
30+
# Modify this value to "invalidate" the dist-newstyle cache only.
31+
DIST_CACHE_VERSION: "20221122"
32+
33+
steps:
34+
35+
- name: "Install System Dependencies via pacman (msys2)"
36+
if: runner.os == 'Windows'
37+
shell: 'C:/msys64/usr/bin/bash.exe -e {0}'
38+
run: |
39+
/usr/bin/pacman -S --noconfirm mingw-w64-x86_64-pkg-config mingw-w64-x86_64-openssl mingw-w64-x86_64-sed base-devel autoconf-wrapper autoconf automake libtool make
40+
41+
- name: Install Haskell
42+
uses: input-output-hk/actions/haskell@latest
43+
id: setup-haskell
44+
with:
45+
ghc-version: ${{ matrix.ghc }}
46+
cabal-version: "3.12.1.0"
47+
48+
- uses: actions/checkout@v6
49+
50+
- name: "Configure cabal.project.local"
51+
run: |
52+
cp scripts/ci/cabal.project.local.${{ runner.os }} cabal.project.local
53+
54+
- name: Update PATH
55+
if: runner.os == 'Windows'
56+
run: |
57+
$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)
58+
echo "PATH=$env:PATH" >> $env:GITHUB_ENV
59+
60+
- name: Update Hackage and CHaP
61+
run: cabal update
62+
63+
- name: Record dependencies
64+
id: record-deps
65+
run: |
66+
cabal build all --dry-run
67+
cat dist-newstyle/cache/plan.json | jq -L .github/workflows/jq-install-plan | sort | uniq > dependencies.txt
68+
69+
- uses: actions/cache/restore@v4
70+
name: "Restore cache: `cabal store`"
71+
id: cache-dependencies
72+
with:
73+
path: ${{ steps.setup-haskell.outputs.cabal-store }}
74+
key: cache-dependencies-${{ env.CABAL_CACHE_VERSION }}-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
75+
restore-keys: cache-dependencies-${{ env.CABAL_CACHE_VERSION }}-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
76+
77+
- uses: actions/cache@v4
78+
name: "Cache `dist-newstyle`"
79+
with:
80+
path: |
81+
dist-newstyle
82+
!dist-newstyle/**/.git
83+
key: cache-dist-${{ env.CABAL_CACHE_VERSION }}-${{ env.DIST_CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project') }}
84+
restore-keys: cache-dist-${{ env.CABAL_CACHE_VERSION }}-${{ env.DIST_CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
85+
86+
- name: Build dependencies
87+
run: cabal build --only-dependencies all -j
88+
89+
- uses: actions/cache/save@v4
90+
name: "Save cache: `cabal store`"
91+
if: always() && steps.cache-dependencies.outputs.cache-hit != 'true'
92+
with:
93+
path: ${{ steps.setup-haskell.outputs.cabal-store }}
94+
key: ${{ steps.cache-dependencies.outputs.cache-primary-key }}
95+
96+
- name: Build all packages
97+
run: cabal build all -j
98+
99+
# Uncomment the following back in for debugging. Remember to launch a `pwsh` from
100+
# the tmux session to debug `pwsh` issues. And be reminded that the `/msys2` and
101+
# `/msys2/mingw64` paths are not in PATH by default for the workflow, but tmate
102+
# will put them in.
103+
# You may also want to run
104+
#
105+
# $env:PATH=("C:\Program Files\PowerShell\7;{0}" -f $env:ORIGINAL_PATH)
106+
#
107+
# to restore the original path. Do note that some test might need msys2
108+
# and will silently fail if msys2 is not in path. See the "Run tests" step.
109+
#
110+
# - name: Setup tmate session
111+
# if: ${{ failure() }}
112+
# uses: mxschmitt/action-tmate@v3
113+
# with:
114+
# limit-access-to-actor: true

.github/workflows/checks.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Project checks
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
merge_group:
10+
11+
jobs:
12+
check-changelogs:
13+
name: Check changelogs
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
steps:
20+
- name: Install dependencies
21+
run: sudo apt install -y fd-find
22+
23+
- uses: actions/checkout@v6
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Check changelogs
28+
run: ./scripts/ci/check-changelogs.sh

.github/workflows/jq-install-plan

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.["install-plan"][].id
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
max-backjumps: 5000
2+
reorder-goals: True
3+
tests: True
4+
benchmarks: True
5+
6+
program-options
7+
ghc-options: -fno-ignore-asserts -Werror
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
max-backjumps: 5000
2+
reorder-goals: True
3+
tests: True
4+
benchmarks: True
5+
6+
-- IPv6 and nothunks tests are DISABLED on Windows
7+
8+
program-options
9+
ghc-options: -fno-ignore-asserts -Werror

0 commit comments

Comments
 (0)