|
23 | 23 | mathlib_ci_ref: |
24 | 24 | type: string |
25 | 25 | required: false |
26 | | - default: 4af75ac0b0d1aaf38d4546a779bc5c68b4d75069 |
| 26 | + default: '' |
27 | 27 |
|
28 | 28 | env: |
29 | 29 | # Disable Lake's automatic fetching of cloud builds. |
@@ -95,16 +95,27 @@ jobs: |
95 | 95 | ref: ${{ inputs.tools_branch_ref != '' && inputs.tools_branch_ref || (github.repository == 'leanprover-community/mathlib4-nightly-testing' && 'nightly-testing-green' || 'master') }} |
96 | 96 | path: tools-branch |
97 | 97 |
|
98 | | - - name: Checkout mathlib-ci |
| 98 | + - name: Checkout local actions |
99 | 99 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
100 | 100 | with: |
101 | | - repository: leanprover-community/mathlib-ci |
102 | | - ref: ${{ inputs.mathlib_ci_ref }} |
| 101 | + ref: ${{ github.workflow_sha }} |
103 | 102 | fetch-depth: 1 |
104 | | - path: ci-tools |
105 | | - |
106 | | - - name: Set up CI scripts paths |
107 | | - uses: ./ci-tools/.github/actions/setup-ci-scripts |
| 103 | + sparse-checkout: .github/actions |
| 104 | + path: workflow-actions |
| 105 | + |
| 106 | + # We need to 'duplicate' this step below because GitHub Actions does not let a `uses:` step |
| 107 | + # conditionally omit a single `with:` key, and passing `ref: ''` would override |
| 108 | + # the composite action's default to the empty string instead of falling back to it |
| 109 | + # Note only one of the two below will actually run in any given run |
| 110 | + - name: Get mathlib-ci |
| 111 | + if: ${{ inputs.mathlib_ci_ref == '' }} |
| 112 | + uses: ./workflow-actions/.github/actions/get-mathlib-ci |
| 113 | + |
| 114 | + - name: Get mathlib-ci |
| 115 | + if: ${{ inputs.mathlib_ci_ref != '' }} |
| 116 | + uses: ./workflow-actions/.github/actions/get-mathlib-ci |
| 117 | + with: |
| 118 | + ref: ${{ inputs.mathlib_ci_ref }} |
108 | 119 |
|
109 | 120 | # Checkout the PR branch into a subdirectory |
110 | 121 | - name: Checkout PR branch |
@@ -193,32 +204,6 @@ jobs: |
193 | 204 | ls .lake/build/bin/check-yaml |
194 | 205 | ls .lake/packages/importGraph/.lake/build/bin/graph |
195 | 206 |
|
196 | | - - name: cleanup .cache/mathlib |
197 | | - # This needs write access to .cache/mathlib, so can't be run inside landrun. |
198 | | - # However it is only using the `tools` version of `cache`, so is safe to run outside landrun. |
199 | | - shell: bash |
200 | | - run: | |
201 | | - # Define the cache directory path |
202 | | - CACHE_DIR="$HOME/.cache/mathlib" |
203 | | -
|
204 | | - # Check if directory exists |
205 | | - if [ ! -d "$CACHE_DIR" ]; then |
206 | | - echo "::warning::Cache directory does not exist: $CACHE_DIR" |
207 | | - exit 0 |
208 | | - fi |
209 | | -
|
210 | | - # Calculate directory size in bytes |
211 | | - DIR_SIZE=$(du -sb "$CACHE_DIR" | cut -f1) |
212 | | - printf 'Cache size (in bytes): %s\n' "$DIR_SIZE" |
213 | | -
|
214 | | - # Check if size exceeds 10GB |
215 | | - if [ "$DIR_SIZE" -gt "10737418240" ]; then |
216 | | - echo "Cache size exceeds threshold, running lake exe cache clean" |
217 | | - # We use the tools-branch version of `cache`. |
218 | | - cd tools-branch |
219 | | - lake exe cache clean |
220 | | - fi |
221 | | -
|
222 | 207 | - name: download dependencies |
223 | 208 | # We need network access to download dependencies |
224 | 209 | # We run this inside landrun, but restrict disk access. |
@@ -489,7 +474,7 @@ jobs: |
489 | 474 |
|
490 | 475 | - name: upload cache staging artifact |
491 | 476 | if: ${{ always() && steps.cache_staging_check.outputs.has_files == 'true' }} |
492 | | - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 477 | + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
493 | 478 | with: |
494 | 479 | name: cache-staging |
495 | 480 | path: cache-staging/ |
@@ -583,20 +568,6 @@ jobs: |
583 | 568 | exit $status |
584 | 569 | done |
585 | 570 |
|
586 | | - # We need to separate this step from the previous script because it needs to run outside of landrun |
587 | | - - name: kill stray runLinter processes |
588 | | - if: ${{ steps.lint.outcome == 'failure' }} |
589 | | - continue-on-error: true |
590 | | - shell: bash |
591 | | - run: | |
592 | | - echo "Checking for runLinter processes..." |
593 | | - if pgrep -af runLinter; then |
594 | | - echo "Killing runLinter processes..." |
595 | | - pkill -f runLinter || true |
596 | | - else |
597 | | - echo "No stray runLinter processes found." |
598 | | - fi |
599 | | -
|
600 | 571 | - name: end gh-problem-match-wrap for shake and lint steps |
601 | 572 | uses: leanprover-community/gh-problem-matcher-wrap@20007cb926a46aa324653a387363b52f07709845 # 2025-04-23 |
602 | 573 | with: |
@@ -685,7 +656,7 @@ jobs: |
685 | 656 | echo "CACHE_BIN=$CACHE_BIN" >> "$GITHUB_ENV" |
686 | 657 |
|
687 | 658 | - name: Download cache staging artifact |
688 | | - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 |
| 659 | + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 |
689 | 660 | with: |
690 | 661 | name: cache-staging |
691 | 662 | path: cache-staging |
@@ -756,7 +727,7 @@ jobs: |
756 | 727 | lake exe graph |
757 | 728 |
|
758 | 729 | - name: upload the import graph |
759 | | - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 730 | + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
760 | 731 | with: |
761 | 732 | name: import-graph |
762 | 733 | path: import_graph.dot |
@@ -801,10 +772,13 @@ jobs: |
801 | 772 | steps: |
802 | 773 | - name: Generate auto merge app token |
803 | 774 | id: auto-merge-app-token |
804 | | - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 |
| 775 | + uses: leanprover-community/mathlib-ci/.github/actions/azure-create-github-app-token@3bb576208589a435eeaeac9b144a1b7c3e948760 |
805 | 776 | with: |
806 | 777 | app-id: ${{ secrets.MATHLIB_AUTO_MERGE_APP_ID }} |
807 | | - private-key: ${{ secrets.MATHLIB_AUTO_MERGE_PRIVATE_KEY }} |
| 778 | + key-vault-name: ${{ vars.MATHLIB_AZ_KEY_VAULT_NAME }} |
| 779 | + key-name: mathlib-auto-merge-app-pk |
| 780 | + azure-client-id: ${{ vars.GH_APP_AZURE_CLIENT_ID_CI_AUTO_MERGE }} |
| 781 | + azure-tenant-id: ${{ secrets.LPC_AZ_TENANT_ID }} |
808 | 782 |
|
809 | 783 | - id: PR_from_push |
810 | 784 | uses: 8BitJonny/gh-get-current-pr@4056877062a1f3b624d5d4c2bedefa9cf51435c9 # 4.0.0 |
@@ -916,7 +890,7 @@ jobs: |
916 | 890 | name: If `auto-merge-after-CI` is present, add a `bors merge` comment. |
917 | 891 | uses: GrantBirki/comment@608e41b19bc973020ec0e189ebfdae935d7fe0cc # v2.1.1 |
918 | 892 | with: |
919 | | - # The create-github-app-token README states that this token is masked and will not be logged accidentally. |
| 893 | + # This token is masked by the token minting action and will not be logged accidentally. |
920 | 894 | token: ${{ steps.auto-merge-app-token.outputs.token }} |
921 | 895 | issue-number: ${{ steps.PR.outputs.number }} |
922 | 896 | body: | |
|
0 commit comments