|
4 | 4 | pull_request:
|
5 | 5 | types: [opened, reopened, synchronize, labeled]
|
6 | 6 |
|
| 7 | +concurrency: |
| 8 | + group: pre-commit-${{github.event.pull_request.number || github.ref}} |
| 9 | + cancel-in-progress: true |
| 10 | + |
7 | 11 | jobs:
|
8 | 12 | lint:
|
9 |
| - if: | |
10 |
| - contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') |
11 |
| - name: Checking if any fixes are needed |
| 13 | + #if: ${{ contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') }} |
| 14 | + name: Run pre-commit hooks |
12 | 15 | runs-on: ubuntu-latest
|
13 | 16 | steps:
|
14 | 17 | - name: Checkout latest commit
|
|
35 | 38 | ~/.cache/pip
|
36 | 39 | key: pre-commit|${{ env.PY_HASH }}|${{ hashFiles('.pre-commit-config.yaml', '.github/workflows/pre-commit.yml') }}
|
37 | 40 |
|
| 41 | + - name: Wait on other jobs to finish |
| 42 | + uses: lucasssvaz/wait-on-workflow@v1 |
| 43 | + id: wait-on-jobs |
| 44 | + continue-on-error: true |
| 45 | + with: |
| 46 | + workflow: push.yml |
| 47 | + max-wait: 5 |
| 48 | + interval: 30 |
| 49 | + timeout: 120 |
| 50 | + sha: ${{ github.event.pull_request.head.sha || github.sha }} |
| 51 | + |
| 52 | + - name: Download compilation artifacts |
| 53 | + uses: actions/download-artifact@v4 |
| 54 | + if: ${{ steps.wait-on-jobs.outputs.run-id != '' }} |
| 55 | + with: |
| 56 | + pattern: build-job-* |
| 57 | + merge-multiple: true |
| 58 | + path: ~/.arduino/tests/ |
| 59 | + run-id: ${{ steps.wait-on-jobs.outputs.run-id }} |
| 60 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + |
| 62 | + - name: Merge compile commands |
| 63 | + if: ${{ steps.wait-on-jobs.outputs.run-id != '' }} |
| 64 | + run: | |
| 65 | + find ~/.arduino/tests/ -iname "compile_commands.json" | xargs jq -s 'map(.[])' > ~/compile_commands.json |
| 66 | +
|
| 67 | + - name: Upload compile commands |
| 68 | + if: ${{ steps.wait-on-jobs.outputs.run-id != '' }} |
| 69 | + uses: actions/upload-artifact@v4 |
| 70 | + with: |
| 71 | + name: compile_commands |
| 72 | + path: ~/compile_commands.json |
| 73 | + |
38 | 74 | - name: Install python dependencies
|
39 | 75 | run: python -m pip install pre-commit docutils
|
40 | 76 |
|
|
0 commit comments