@@ -222,7 +222,7 @@ jobs:
222222
223223 - name : validate lake-manifest.json inputRevs
224224 # Only enforce this on the main mathlib4 repository, not on nightly-testing
225- if : github.repository == 'leanprover-community/mathlib4'
225+ if : github.repository == 'leanprover-community/mathlib4' && github.ref_name != 'nightly-testing'
226226 shell : bash
227227 run : |
228228 cd pr-branch
@@ -451,7 +451,7 @@ jobs:
451451
452452 - name : upload cache staging artifact
453453 if : ${{ always() && steps.cache_staging_check.outputs.has_files == 'true' }}
454- uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
454+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
455455 with :
456456 name : cache-staging
457457 path : cache-staging/
@@ -513,19 +513,19 @@ jobs:
513513 run : |
514514 cd pr-branch
515515 set -o pipefail
516- # Try running with --trace; if it fails due to argument parsing, the PR needs to merge master
516+ # If lint fails because the PR predates lake-lint configuration or the
517+ # old --trace argument-parsing behavior, ask the author to merge master.
517518 # We use .lake/ for the output file because landrun restricts /tmp access
518519 for attempt in 1 2; do
519- if timeout 10m env LEAN_ABORT_ON_PANIC=1 stdbuf -oL lake exe runLinter --trace Mathlib 2>&1 | tee ".lake/lint_output_attempt_${attempt}.txt"; then
520+ if timeout 10m env LEAN_ABORT_ON_PANIC=1 stdbuf -oL lake lint -- --trace 2>&1 | tee ".lake/lint_output_attempt_${attempt}.txt"; then
520521 break
521522 fi
522523 status=${PIPESTATUS[0]}
523- if grep -q "cannot parse arguments" ".lake/lint_output_attempt_${attempt}.txt"; then
524+ if grep -qE "cannot parse arguments|no lint driver configured " ".lake/lint_output_attempt_${attempt}.txt"; then
524525 echo ""
525526 echo "=============================================================================="
526- echo "ERROR: Your branch uses an older version of runLinter that doesn't support"
527- echo "the --trace flag. Please merge 'master' into your PR branch to get the"
528- echo "updated linter, then push again."
527+ echo "ERROR: Your branch predates the current 'lake lint' configuration."
528+ echo "Please merge 'master' into your PR branch and push again."
529529 echo ""
530530 echo "You can do this with:"
531531 echo " git fetch upstream"
@@ -574,12 +574,14 @@ jobs:
574574 - name : Generate lean-pr-testing app token
575575 if : ${{ always() && github.repository == 'leanprover-community/mathlib4-nightly-testing' && (startsWith(github.ref_name, 'lean-pr-testing-') || startsWith(github.ref_name, 'batteries-pr-testing-')) }}
576576 id : lean-pr-testing-token
577- uses : actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
577+ uses : actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
578578 with :
579- app-id : ${{ secrets.MATHLIB_LEAN_PR_TESTING_APP_ID }}
580- private-key : ${{ secrets.MATHLIB_LEAN_PR_TESTING_PRIVATE_KEY }}
581- owner : leanprover
582- repositories : lean4
579+ # `batteries-pr-testing-*` branches need a token scoped to `leanprover-community/batteries`
580+ # for the labelling API; `lean-pr-testing-*` branches need one scoped to `leanprover/lean4`.
581+ app-id : ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && secrets.MATHLIB_NIGHTLY_TESTING_APP_ID || secrets.MATHLIB_LEAN_PR_TESTING_APP_ID }}
582+ private-key : ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && secrets.MATHLIB_NIGHTLY_TESTING_PRIVATE_KEY || secrets.MATHLIB_LEAN_PR_TESTING_PRIVATE_KEY }}
583+ owner : ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && 'leanprover-community' || 'leanprover' }}
584+ repositories : ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && 'batteries' || 'lean4' }}
583585 # The create-github-app-token README states that this token is masked and will not be logged accidentally.
584586 - name : Post comments for lean-pr-testing-NNNN and batteries-pr-testing-NNNN branches
585587 if : ${{ always() && github.repository == 'leanprover-community/mathlib4-nightly-testing' && (startsWith(github.ref_name, 'lean-pr-testing-') || startsWith(github.ref_name, 'batteries-pr-testing-')) }}
@@ -618,7 +620,7 @@ jobs:
618620 fetch-depth : 1
619621
620622 - name : Configure Lean
621- uses : leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4 .0
623+ uses : leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5 .0
622624 with :
623625 auto-config : false # Don't run `lake build`, `lake test`, or `lake lint` automatically.
624626 use-github-cache : false
@@ -689,7 +691,7 @@ jobs:
689691 ref : ${{ inputs.pr_branch_ref }}
690692
691693 - name : Configure Lean
692- uses : leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4 .0
694+ uses : leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5 .0
693695 with :
694696 auto-config : false # Don't run `lake build`, `lake test`, or `lake lint` automatically.
695697 use-github-cache : false
@@ -731,17 +733,36 @@ jobs:
731733 run : |
732734 lake exe graph
733735
736+ - name : Checkout local actions
737+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
738+ with :
739+ ref : ${{ github.workflow_sha }}
740+ fetch-depth : 1
741+ sparse-checkout : .github/actions
742+ path : workflow-actions
743+
744+ - name : Get mathlib-ci
745+ uses : ./workflow-actions/.github/actions/get-mathlib-ci
746+
747+ - name : dump declarations and transitive-import counts
748+ run : |
749+ lake env lean --run "${CI_SCRIPTS_DIR}/pr_summary/dumpReasonableDecls.lean" \
750+ --out decls.txt --imports-out imports.json Mathlib
751+
734752 - name : upload the import graph
735- uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
753+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
736754 with :
737755 name : import-graph
738- path : import_graph.dot
739- # # the default is 90, but we build often, so unless there's a reason
740- # # to care about old copies in the future, just say 7 days for now
741- retention-days : 7
756+ path : |
757+ import_graph.dot
758+ decls.txt
759+ imports.json
760+ # # Master pushes: 90 days, so later PRs forked from these commits
761+ # # can consume the dumps from the artifact. Other branches: 7 days.
762+ retention-days : ${{ github.ref == 'refs/heads/master' && '90' || '7' }}
742763
743764 - name : clean up the import graph file
744- run : rm import_graph.dot
765+ run : rm -f import_graph.dot decls.txt imports.json
745766
746767 - name : check all scripts build successfully
747768 run : |
@@ -874,7 +895,7 @@ jobs:
874895 steps.get-label-actor.outputs.username != 'mathlib-update-dependencies' &&
875896 steps.get-label-actor.outputs.username != 'mathlib-splicebot'
876897 name: check team membership
877- uses: tspascoal/get-user-teams-membership@57e9f42acd78f4d0f496b3be4368fc5f62696662 # v3 .0.0
898+ uses: tspascoal/get-user-teams-membership@818140d631d5f29f26b151afbe4179f87d9ceb5e # v4 .0.1
878899 id: actorTeams
879900 with:
880901 organization: leanprover-community # optional. Default value ${{ github.repository_owner }}
0 commit comments