Skip to content

Commit b6062c1

Browse files
committed
Merge remote-tracking branch 'origin/instmulaction' into galfields_wip
2 parents 086d8eb + 50a6a6c commit b6062c1

1,497 files changed

Lines changed: 35609 additions & 16846 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/add_label_from_diff.yaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,42 @@ jobs:
2121
# Don't run on forks, where we wouldn't have permissions to add the label anyway.
2222
if: github.repository == 'leanprover-community/mathlib4'
2323
steps:
24-
- name: Checkout code
24+
- name: Checkout master branch to build autolabel from
2525
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2626
with:
27-
ref: ${{ github.event.pull_request.head.sha }}
28-
fetch-depth: 0
27+
ref: master
28+
path: tools
2929
- name: Configure Lean
3030
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
3131
with:
3232
auto-config: false
3333
use-github-cache: false
3434
use-mathlib-cache: false
35-
- name: lake exe autolabel
35+
lake-package-directory: tools # Building here
36+
- name: Build autolabel from master
37+
working-directory: tools
38+
run: |
39+
lake build autolabel
40+
- name: Checkout branch to label
41+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
42+
with:
43+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
44+
fetch-depth: 0
45+
path: pr-branch
46+
- name: Run autolabel
47+
working-directory: pr-branch
3648
run: |
37-
# the checkout dance, to avoid a detached head
38-
git checkout master
39-
git checkout -
40-
labels="$(lake exe autolabel)"
49+
labels="$("${GITHUB_WORKSPACE}/tools/.lake/build/bin/autolabel")"
4150
printf '%s\n' "${labels}"
4251
# extract
4352
label="$(printf '%s' "${labels}" | sed -n 's=^::notice::.*#\[\([^,]*\)\].*=\1=p')"
4453
printf 'label: "%s"\n' "${label}"
45-
if [ -n "${label}" ]
54+
if [ -n "${label}" ] && [ -n "${PR_NUMBER}" ]
4655
then
4756
printf 'Applying label %s\n' "${label}"
4857
# we use curl rather than octokit/request-action so that the job won't fail
4958
# (and send an annoying email) if the labels don't exist
50-
url="https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels"
59+
url="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/labels"
5160
printf 'url: %s\n' "${url}"
5261
jsonLabel="$(printf '{"labels":["%s"]}' "${label}")"
5362
printf 'jsonLabel: %s\n' "${jsonLabel}"
@@ -62,3 +71,6 @@ jobs:
6271
fi
6372
env:
6473
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
# the PR number could be undefined in workflows triggered by 'push',
75+
# in which case we only log the applicable label and exit
76+
PR_NUMBER: ${{ github.event.pull_request.number }}

.github/workflows/auto_assign_reviewers.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/bors.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- staging
7+
- trying
78

89
concurrency:
910
# label each workflow run; only the latest with each label will run
@@ -19,11 +20,15 @@ permissions:
1920

2021
jobs:
2122
build:
23+
name: ci (staging)
2224
if: ${{ github.repository == 'leanprover-community/mathlib4' || github.repository == 'leanprover-community/mathlib4-nightly-testing' }}
2325
uses: ./.github/workflows/build_template.yml
2426
with:
2527
concurrency_group: ${{ github.workflow }}-${{ github.ref }}-${{ github.run_id }}
2628
pr_branch_ref: ${{ github.sha }}
27-
job_name_suffix: ""
28-
runs_on: bors
29+
# bors runs should build the tools from their commit-under-test: after all, we are trying to
30+
# test 'what would happen if this was merged', so we need to use the 'would-be-post-merge' tools
31+
tools_branch_ref: ${{ github.sha }}
32+
# We don't wan't 'bors try' runs to compete with merge-candidates, so we pool trying with PR runs
33+
runs_on: ${{ github.ref_name == 'trying' && 'pr' || 'bors' }}
2934
secrets: inherit

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ on:
77
- 'staging.tmp*'
88
- 'trying.tmp*'
99
- 'staging*.tmp'
10-
# ignore staging branch used by bors, this is handled by bors.yml
10+
# ignore staging and trying branches used by bors, these are handled by bors.yml
1111
- 'staging'
12+
- 'trying'
13+
# ignore branches meant for experiments
14+
- 'ci-dev/**'
1215
merge_group:
1316

1417
concurrency:
@@ -26,11 +29,11 @@ permissions:
2629

2730
jobs:
2831
build:
32+
name: ci
2933
if: ${{ github.repository == 'leanprover-community/mathlib4' || github.repository == 'leanprover-community/mathlib4-nightly-testing' }}
3034
uses: ./.github/workflows/build_template.yml
3135
with:
3236
concurrency_group: ${{ github.workflow }}-${{ github.ref }}-${{ (github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id) || '' }}
3337
pr_branch_ref: ${{ github.sha }}
34-
job_name_suffix: ""
3538
runs_on: pr
3639
secrets: inherit

.github/workflows/build_fork.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
- 'trying.tmp*'
99
- 'staging*.tmp'
1010
- 'nolints'
11+
paths-ignore:
12+
# pull_request_target uses the workflow from the target branch:
13+
# PR changes under this directory won't affect this run, so
14+
# running it is just wasteful
15+
- '.github/workflows/**'
1116

1217
concurrency:
1318
# label each workflow run; only the latest with each label will run
@@ -24,11 +29,11 @@ permissions:
2429

2530
jobs:
2631
build:
32+
name: ci (fork)
2733
if: ${{ github.event.pull_request.head.repo.fork && github.repository != 'leanprover-community/mathlib4-nightly-testing' }}
2834
uses: ./.github/workflows/build_template.yml
2935
with:
3036
concurrency_group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
3137
pr_branch_ref: ${{ github.event.pull_request.head.sha }}
32-
job_name_suffix: ' (fork)'
3338
runs_on: pr
3439
secrets: inherit

0 commit comments

Comments
 (0)