|
17 | 17 | COMMIT_SHA: ${{ github.sha }}
|
18 | 18 | ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
19 | 19 | ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
| 20 | + RUN_JOBS: ${{ github.repository == 'spring-projects/spring-security' }} |
20 | 21 |
|
21 | 22 | jobs:
|
22 |
| - initiate_error_tracking: |
23 |
| - name: Initiate job-level error tracking |
| 23 | + prerequisites: |
| 24 | + name: Pre-requisites for building |
24 | 25 | runs-on: ubuntu-latest
|
| 26 | + outputs: |
| 27 | + runjobs: ${{ steps.continue.outputs.runjobs }} |
25 | 28 | steps:
|
26 | 29 | - uses: actions/checkout@v2
|
27 | 30 | - name: Initiate error tracking
|
28 | 31 | uses: spring-projects/track-build-errors-action@v1
|
29 | 32 | with:
|
30 |
| - job-name: "initiate-error-tracking" |
| 33 | + job-name: "prerequisites" |
31 | 34 | - name: Export errors file
|
32 | 35 | uses: actions/upload-artifact@v2
|
33 | 36 | with:
|
34 | 37 | name: errors
|
35 |
| - path: job-initiate-error-tracking.txt |
| 38 | + path: job-prerequisites.txt |
| 39 | + - id: continue |
| 40 | + name: Determine if should continue |
| 41 | + run: echo "::set-output name=runjobs::${RUN_JOBS}" |
36 | 42 | build_jdk_11:
|
37 | 43 | name: Build JDK 11
|
| 44 | + needs: [prerequisites] |
38 | 45 | runs-on: ubuntu-latest
|
| 46 | + if: needs.prequisites.outputs.runjobs == 'true' |
39 | 47 | steps:
|
40 | 48 | - uses: actions/checkout@v2
|
41 | 49 | - name: Set up JDK 11
|
|
66 | 74 | path: job-${{ github.job }}.txt
|
67 | 75 | snapshot_tests:
|
68 | 76 | name: Test against snapshots
|
| 77 | + needs: [prerequisites] |
69 | 78 | runs-on: ubuntu-latest
|
| 79 | + if: needs.prequisites.outputs.runjobs == 'true' |
70 | 80 | steps:
|
71 | 81 | - uses: actions/checkout@v2
|
72 | 82 | - name: Set up JDK
|
|
92 | 102 | path: job-${{ github.job }}.txt
|
93 | 103 | sonar_analysis:
|
94 | 104 | name: Static Code Analysis
|
| 105 | + needs: [prerequisites] |
95 | 106 | runs-on: ubuntu-latest
|
| 107 | + if: needs.prequisites.outputs.runjobs == 'true' |
96 | 108 | env:
|
97 | 109 | SONAR_URL: ${{ secrets.SONAR_URL }}
|
98 | 110 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
0 commit comments