Skip to content

Commit f4f2c2c

Browse files
committed
Sync CI configuration with master
1 parent 9f5c8e8 commit f4f2c2c

18 files changed

+513
-123
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: ''
5-
labels: ''
5+
labels: ["type: bug", "needs triage"]
66
assignees: ''
77

88
---
@@ -14,11 +14,9 @@ A clear and concise description of what the bug is.
1414
Steps to reproduce the behavior:
1515

1616
```
17-
$ cabal v2-build ...
17+
$ cabal build ...
1818
```
1919

20-
Please use version-prefixed commands (e.g. `v2-build` or `v1-build`) to avoid ambiguity.
21-
2220
**Expected behavior**
2321
A clear and concise description of what you expected to happen.
2422

@@ -28,3 +26,4 @@ A clear and concise description of what you expected to happen.
2826

2927
**Additional context**
3028
Add any other context about the problem here.
29+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Documentation
3+
about: Report missing, stale, or inaccurate documentation
4+
title: ''
5+
labels: ["documentation"]
6+
assignees: ''
7+
8+
---
9+
10+
**What is wrong with the docs?**
11+
Describe what you were searching. Was documentation not there? Was it outdated? Was it not clear?
12+
13+
**Additional context**
14+
Add any other relevant context here.
15+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new feature
4+
title: ''
5+
labels: ["type: enhancement"]
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the feature request**
11+
A simple description of what you would like to be added to Cabal.
12+
13+
**Additional context**
14+
What made you ask for this functionality? How would the feature benefit you and other users? Add any other relevant context about the request here.
15+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Question
3+
about: Ask a question to the developers
4+
title: ''
5+
labels: ["type: user-question"]
6+
assignees: ''
7+
8+
---
9+
10+
Two great places to ask questions are [Haskell Matrix](https://matrix.to/#/#haskell:matrix.org) (online chat) and [Haskell Discourse](https://discourse.haskell.org). There are many experienced programmers there who can quickly help you with using Cabal and `cabal-install`.
11+
12+
If you did not find an answer to your question, fill in this template.
13+
14+
**What is your question?**
15+
State your question in simple terms. What were you attempting to do? What have you have tried?
16+
17+
**System information**
18+
- Operating system
19+
- `cabal`, `ghc` versions
20+
21+
**Additional context**
22+
Add any other relevant context here.
23+

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# From:
2+
# - https://github.com/haskell/hackage-server
3+
# - https://github.com/rhysd/actionlint/issues/228#issuecomment-1272493095
4+
# - https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
5+
6+
# Set update schedule for GitHub Actions
7+
8+
version: 2
9+
updates:
10+
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
# Check for updates to GitHub Actions every week
15+
interval: "weekly"

.github/mergify.yml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
pull_request_rules:
2+
3+
# implementing PR delay logic: apply a label after 2 days of inactivity
4+
# the label will allow Mergify to merge (see #8442, #8448)
5+
- actions:
6+
label:
7+
add:
8+
- merge delay passed
9+
name: Wait for 2 days before validating merge
10+
conditions:
11+
- updated-at<2 days ago
12+
- or:
13+
- label=merge me
14+
- label=squash+merge me
15+
- label=merge+no rebase
16+
- '#approved-reviews-by>=2'
17+
218
# rebase+merge strategy
319
- actions:
420
queue:
@@ -9,8 +25,11 @@ pull_request_rules:
925
update_method: rebase
1026
name: Put pull requests in the rebase+merge queue
1127
conditions:
28+
- base=master
1229
- label=merge me
30+
- label=merge delay passed
1331
- '#approved-reviews-by>=2'
32+
1433
# merge+squash strategy
1534
- actions:
1635
queue:
@@ -21,9 +40,46 @@ pull_request_rules:
2140
update_method: merge
2241
name: Put pull requests in the squash+merge queue
2342
conditions:
43+
- base=master
2444
- label=squash+merge me
45+
- label=merge delay passed
2546
- '#approved-reviews-by>=2'
2647

48+
# merge+no rebase strategy
49+
- actions:
50+
merge:
51+
method: merge
52+
name: Merge "merge+no rebase" pull requests directly (without a queue)
53+
conditions:
54+
- base=master
55+
- label=merge+no rebase
56+
- label=merge delay passed
57+
- '#approved-reviews-by>=2'
58+
59+
# rebase+merge strategy for backports: require 1 approver instead of 2
60+
- actions:
61+
queue:
62+
name: default
63+
# Merge with a merge commit
64+
method: merge
65+
# Update the pr branch with rebase, so the history is clean
66+
update_method: rebase
67+
name: Put backports in the rebase+merge queue
68+
conditions:
69+
- label=merge me
70+
- base!=master
71+
- body~=backport
72+
- '#approved-reviews-by>=1'
73+
74+
# backports should be labeled as such
75+
- actions:
76+
label:
77+
add:
78+
- backport
79+
name: Label backports as such
80+
conditions:
81+
- body~=automatic backport
82+
2783
queue_rules:
2884
- name: default
29-
conditions: []
85+
update_bot_account: Mikolaj

.github/pull_request_template.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Please read [Github PR Conventions](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#github-pull-request-conventions) and then fill in *one* of these two templates.
2+
3+
---
4+
5+
**Template Α: This PR modifies `cabal` behaviour**
6+
7+
Include the following checklist in your PR:
8+
9+
* [ ] Patches conform to the [coding conventions](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#other-conventions).
10+
* [ ] Any changes that could be relevant to users [have been recorded in the changelog](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#changelog).
11+
* [ ] The documentation has been updated, if necessary.
12+
* [ ] [Manual QA notes](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#qa-notes) have been included.
13+
* [ ] Tests have been added. (*Ask for help if you don’t know how to write them! Ask for an exemption if tests are too complex for too little coverage!*)
14+
15+
---
16+
17+
**Template Β: This PR does not modify `cabal` behaviour (documentation, tests, refactoring, etc.)**
18+
19+
Include the following checklist in your PR:
20+
21+
* [ ] Patches conform to the [coding conventions](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#other-conventions).
22+

.github/workflows/bootstrap.skip.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Bootstrap Skip
2+
3+
# This Workflow is special and contains a workaround for a known limitation of GitHub CI.
4+
#
5+
# The problem: We don't want to run the "bootstrap" jobs on PRs which contain only changes
6+
# to the docs, since these jobs take a long time to complete without providing any benefit.
7+
# We therefore use path-filtering in the workflow triggers for the bootstrap jobs, namely
8+
# "paths-ignore: doc/**". But the "Bootstrap post job" is a required job, therefore a PR cannot
9+
# be merged unless the "Bootstrap post job" completes succesfully, which it doesn't do if we
10+
# filter it out.
11+
#
12+
# The solution: We use a second job with the same name which always returns the exit code 0.
13+
# The logic implemented for "required" workflows accepts if 1) at least one job with that name
14+
# runs through, AND 2) If multiple jobs of that name exist, then all jobs of that name have to
15+
# finish successfully.
16+
on:
17+
push:
18+
paths:
19+
- 'doc/**'
20+
- '**/README.md'
21+
- 'CONTRIBUTING.md'
22+
branches:
23+
- master
24+
pull_request:
25+
paths:
26+
- 'doc/**'
27+
- '**/README.md'
28+
- 'CONTRIBUTING.md'
29+
release:
30+
types:
31+
- created
32+
33+
jobs:
34+
bootstrap-post-job:
35+
if: always()
36+
name: Bootstrap post job
37+
runs-on: ubuntu-latest
38+
steps:
39+
- run: exit 0

.github/workflows/bootstrap.yml

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@ concurrency:
55
group: ${{ github.ref }}-${{ github.workflow }}
66
cancel-in-progress: true
77

8+
# Note: This workflow file contains the required job "Bootstrap post job". We are using path filtering
9+
# here to ignore PRs which only change documentation. This can cause a problem, see the workflow file
10+
# "bootstrap.skip.yml" for a description of the problem and the solution provided in that file.
811
on:
912
push:
13+
paths-ignore:
14+
- 'doc/**'
15+
- '**/README.md'
16+
- 'CONTRIBUTING.md'
1017
branches:
1118
- master
1219
pull_request:
20+
paths-ignore:
21+
- 'doc/**'
22+
- '**/README.md'
23+
- 'CONTRIBUTING.md'
1324
release:
1425
types:
1526
- created
@@ -19,27 +30,67 @@ jobs:
1930
strategy:
2031
matrix:
2132
os: [ubuntu-latest]
22-
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2", "9.2.3"]
33+
ghc: ["8.10.7", "9.0.2", "9.2.7", "9.4.4"]
2334
include:
2435
- os: macos-latest
25-
ghc: "9.2.3"
36+
ghc: "9.2.7"
2637
name: Bootstrap ${{ matrix.os }} ghc-${{ matrix.ghc }}
2738
runs-on: ${{ matrix.os }}
2839
steps:
29-
- uses: actions/checkout@v2
40+
- uses: actions/cache@v3
41+
name: Cache the downloads
42+
id: bootstrap-cache
43+
with:
44+
path: "/home/runner/work/cabal/cabal/_build"
45+
key: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115-${{ github.sha }}
46+
restore-keys: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115-
47+
48+
- uses: actions/checkout@v4
49+
# See https://github.com/haskell/cabal/pull/8739
50+
- name: Sudo chmod to permit ghcup to update its cache
51+
run: |
52+
if [[ "${{ runner.os }}" == "Linux" ]]; then
53+
sudo ls -lah /usr/local/.ghcup/cache
54+
sudo mkdir -p /usr/local/.ghcup/cache
55+
sudo ls -lah /usr/local/.ghcup/cache
56+
sudo chown -R $USER /usr/local/.ghcup
57+
sudo chmod -R 777 /usr/local/.ghcup
58+
fi
3059
- name: bootstrap.py
3160
run: |
3261
GHC_VERSION=${{ matrix.ghc }}
62+
ghcup --version
3363
ghcup config set cache true
3464
ghcup install ghc $GHC_VERSION
35-
# We use linux dependencies also on macos
36-
python3 bootstrap/bootstrap.py -w $(ghcup whereis ghc $GHC_VERSION) -d bootstrap/linux-$GHC_VERSION.json
65+
66+
# Fetch the bootstrap sources (we use linux dependencies also on macos)
67+
python3 bootstrap/bootstrap.py -w $(ghcup whereis ghc $GHC_VERSION) -d bootstrap/linux-$GHC_VERSION.json fetch
68+
69+
# Bootstrap using the bootstrap sources
70+
python3 bootstrap/bootstrap.py -w $(ghcup whereis ghc $GHC_VERSION) --bootstrap-sources bootstrap-sources.tar.gz
3771
3872
- name: Smoke test
3973
run: |
4074
_build/bin/cabal --version
4175
42-
- uses: actions/upload-artifact@v2
76+
- uses: actions/upload-artifact@v3
4377
with:
4478
name: cabal-${{ matrix.os }}-${{ matrix.ghc }}-bootstrapped
4579
path: _build/artifacts/*
80+
81+
# We use this job as a summary of the workflow
82+
# It will fail if any of the previous jobs does it
83+
# This way we can use it exclusively in branch protection rules
84+
# and abstract away the concrete jobs of the workflow, including their names
85+
bootstrap-post-job:
86+
if: always()
87+
name: Bootstrap post job
88+
runs-on: ubuntu-latest
89+
# IMPORTANT! Any job added to the workflow should be added here too
90+
needs: [bootstrap]
91+
92+
steps:
93+
- run: |
94+
echo "jobs info: ${{ toJSON(needs) }}"
95+
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
96+
run: exit 1

.github/workflows/changelogs.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,37 @@ jobs:
2929
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
3030
run: |
3131
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
32-
- uses: actions/cache@v1
32+
- uses: actions/cache@v3
3333
with:
3434
path: ~/.cabal/store
3535
key: linux-store-changelogs
36+
# See https://github.com/haskell/cabal/pull/8739
37+
- name: Sudo chmod to permit ghcup to update its cache
38+
run: |
39+
if [[ "${{ runner.os }}" == "Linux" ]]; then
40+
sudo mkdir -p /usr/local/.ghcup/cache
41+
sudo chown -R $USER /usr/local/.ghcup
42+
sudo chmod -R 777 /usr/local/.ghcup
43+
fi
3644
- name: ghcup
3745
run: |
3846
ghcup config set cache true
39-
ghcup install ghc 8.10.7
40-
ghcup set ghc 8.10.7
41-
# GHC 8.10.7 needed due to https://github.com/phadej/changelog-d/pull/2
47+
ghcup install ghc recommended
48+
ghcup set ghc recommended
4249
- name: Update Hackage index
4350
run: cabal v2-update
4451
# Cannot install it from tarball due to
4552
# https://github.com/haskell/cabal/issues/7360
46-
- uses: actions/checkout@v3
53+
- uses: actions/checkout@v4
4754
with:
48-
repository: "phadej/changelog-d"
55+
repository: "fgaz/changelog-d"
4956
path: "changelog-d"
5057
- name: Install changelog-d
5158
run: |
5259
pushd changelog-d
5360
cabal v2-install
5461
popd
55-
- uses: actions/checkout@v3
62+
- uses: actions/checkout@v4
5663
- name: Run changelog-d
5764
run: |
5865
changelog-d changelog.d

0 commit comments

Comments
 (0)