Skip to content

Commit

Permalink
Trigger CI for leanprover/lean4#3160
Browse files Browse the repository at this point in the history
  • Loading branch information
leanprover-community-mathlib4-bot committed Aug 15, 2024
2 parents 5f62e8f + 7e5b9c7 commit 9763a6c
Show file tree
Hide file tree
Showing 5,357 changed files with 490,298 additions and 436,355 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

"onCreateCommand": "lake exe cache get!",

"hostRequirements": {
"cpus": 4
},

"customizations": {
"vscode" : {
"extensions" : [ "leanprover.lean4" ]
Expand Down
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,29 @@
PR is merged. Please leave a blank newline before the `---`, otherwise
GitHub will format the text above it as a title.
For details on the "pull request lifecycle" in mathlib, please see:
https://leanprover-community.github.io/contribute/index.html
In particular, note that most reviewers will only notice your PR
if it passes the continuous integration checks.
Please ask for help on https://leanprover.zulipchat.com if needed.
To indicate co-authors, include lines at the bottom of the commit message
(that is, before the `---`) using the following format:
Co-authored-by: Author Name <author@email.com>
If you are moving or deleting declarations, please include these lines at the bottom of the commit message
(that is, before the `---`) using the following format:
Moves:
- Vector.* -> Mathlib.Vector.*
- ...
Deletions:
- Nat.bit1_add_bit1
- ...
Any other comments you want to keep out of the PR commit should go
below the `---`, and placed outside this HTML comment, or else they
will be invisible to reviewers.
Expand All @@ -17,6 +35,7 @@ If this PR depends on other PRs, please list them below this comment,
using the following format:
- [ ] depends on: #abc [optional extra text]
- [ ] depends on: #xyz [optional extra text]
-->

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
4 changes: 4 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
self-hosted-runner:
labels:
- bors
- pr
85 changes: 85 additions & 0 deletions .github/workflows/PR_summary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Post PR summary comment

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get install -y jq
# If you have additional dependencies, install them here
- name: Get changed files
run: |
git fetch origin ${{ github.base_ref }} # fetch the base branch
git diff --name-only origin/${{ github.base_ref }}... > changed_files.txt # get the list of changed files
- name: Compute transitive imports
run: |
# the checkout dance, to avoid a detached head
git checkout master
git checkout -
currentHash="$(git rev-parse HEAD)"
# Compute the counts for the HEAD of the PR
python ./scripts/count-trans-deps.py "Mathlib/" > head.json
# Checkout the merge base
git checkout "$(git merge-base master ${{ github.sha }})"
# Compute the counts for the merge base
python ./scripts/count-trans-deps.py "Mathlib/" > base.json
# switch back to the current branch: the `declarations_diff` script should be here
git checkout "${currentHash}"
- name: Post or update the summary comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: ${{ github.head_ref }}
run: |
PR="${{ github.event.pull_request.number }}"
title="### PR summary"
## Import count comment
importCount=$(
python ./scripts/import-graph-report.py base.json head.json changed_files.txt
./scripts/import_trans_difference.sh
)
if [ "$(printf '%s' "${importCount}" | wc -l)" -gt 12 ]
then
importCount="$(printf '<details><summary>\n\n%s\n\n</summary>\n\n%s\n\n</details>\n' "#### Import changes for modified files" "${importCount}")"
else
importCount="$(printf '#### Import changes for modified files\n\n%s\n' "${importCount}")"
fi
## Declarations' diff comment
declDiff=$(./scripts/declarations_diff.sh)
if [ "$(printf '%s' "${declDiff}" | wc -l)" -gt 15 ]
then
declDiff="$(printf '<details><summary>\n\n%s\n\n</summary>\n\n%s\n\n</details>\n' "#### Declarations diff" "${declDiff}")"
else
declDiff="$(printf '#### Declarations diff\n\n%s\n' "${declDiff}")"
fi
git checkout "${BRANCH_NAME}"
currentHash="$(git rev-parse HEAD)"
hashURL="https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}/commits/${currentHash}"
message="$(printf '%s [%s](%s)\n\n%s\n\n---\n\n%s\n' "${title}" "$(git rev-parse --short HEAD)" "${hashURL}" "${importCount}" "${declDiff}")"
./scripts/update_PR_comment.sh "${message}" "${title}" "${PR}"
20 changes: 20 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Actionlint
on:
push:
branches:
- 'master'
paths:
- '.github/**'
pull_request:
paths:
- '.github/**'
merge_group:

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: actionlint
uses: raven-actions/actionlint@v1
15 changes: 1 addition & 14 deletions .github/workflows/add_label_from_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,10 @@ jobs:

- if: (steps.parse_pr_head.outputs.head_user == 'leanprover-community') && (steps.parse_user.outputs.permission == 'admin')
id: remove_labels
name: Remove "awaiting-review" and "awaiting-author"
name: Remove "awaiting-author"
# we use curl rather than octokit/request-action so that the job won't fail
# (and send an annoying email) if the labels don't exist
run: |
curl --request DELETE \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels/awaiting-review \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}'
curl --request DELETE \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels/awaiting-author \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}'
Expand Down Expand Up @@ -131,13 +128,3 @@ jobs:
labels: '["delegated"]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: (steps.parse_pr_head.outputs.head_user == 'leanprover-community') && (steps.parse_user.outputs.permission == 'admin')
id: remove_labels
name: Remove "awaiting-review"
# we use curl rather than octokit/request-action so that the job won't fail
# (and send an annoying email) if the labels don't exist
run: |
curl --request DELETE \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels/awaiting-review \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}'
15 changes: 1 addition & 14 deletions .github/workflows/add_label_from_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,10 @@ jobs:

- if: (steps.parse_pr_head.outputs.head_user == 'leanprover-community') && (steps.parse_user.outputs.permission == 'admin')
id: remove_labels
name: Remove "awaiting-review" and "awaiting-author"
name: Remove "awaiting-author"
# we use curl rather than octokit/request-action so that the job won't fail
# (and send an annoying email) if the labels don't exist
run: |
curl --request DELETE \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/awaiting-review \
--header 'authorization: Bearer ${{ secrets.TRIAGE_TOKEN }}'
curl --request DELETE \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/awaiting-author \
--header 'authorization: Bearer ${{ secrets.TRIAGE_TOKEN }}'
Expand Down Expand Up @@ -131,13 +128,3 @@ jobs:
labels: '["delegated"]'
env:
GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }}

- if: (steps.parse_pr_head.outputs.head_user == 'leanprover-community') && (steps.parse_user.outputs.permission == 'admin')
id: remove_labels
name: Remove "awaiting-review"
# we use curl rather than octokit/request-action so that the job won't fail
# (and send an annoying email) if the labels don't exist
run: |
curl --request DELETE \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/awaiting-review \
--header 'authorization: Bearer ${{ secrets.TRIAGE_TOKEN }}'
Loading

0 comments on commit 9763a6c

Please sign in to comment.