|
5 | 5 | branches: [ master ] |
6 | 6 |
|
7 | 7 | jobs: |
| 8 | + check-run: |
| 9 | + name: Check CI run |
| 10 | + runs-on: ubuntu-latest |
| 11 | + outputs: |
| 12 | + need-run: ${{ steps.check.outputs.need-run }} |
| 13 | + env: |
| 14 | + PR_LABEL_DEPS: contains(github.event.pull_request.labels.*.name, 'dependencies') |
| 15 | + PR_LABEL_RUBY: contains(github.event.pull_request.labels.*.name, 'ruby') |
| 16 | + PR_LABEL_RBI: contains(github.event.pull_request.labels.*.name, 'rbi-ready') |
| 17 | + PR_NEED_RUN: | |
| 18 | + (contains(github.event.pull_request.labels.*.name, 'dependencies') && |
| 19 | + contains(github.event.pull_request.labels.*.name, 'ruby') && |
| 20 | + contains(github.event.pull_request.labels.*.name, 'tapioca-ready')) || ( |
| 21 | + !contains(github.event.pull_request.labels.*.name, 'dependencies') && |
| 22 | + !contains(github.event.pull_request.labels.*.name, 'ruby')) |
| 23 | + steps: |
| 24 | + - name: Dump PR labels |
| 25 | + run: | |
| 26 | + echo "PR_LABEL_DEPS: ${{ env.PR_LABEL_DEPS }}" |
| 27 | + echo "PR_LABEL_RUBY: ${{ env.PR_LABEL_RUBY }}" |
| 28 | + echo "PR_LABEL_RBI: ${{ env.PR_LABEL_RBI }}" |
| 29 | + echo "PR_NEED_RUN: ${{ env.PR_NEED_RUN }}" |
| 30 | + - name: Check for dependencies label |
| 31 | + id: check |
| 32 | + run: echo ::set-output name=need-run::${{ env.PR_NEED_RUN }} |
| 33 | + |
8 | 34 | analyze: |
| 35 | + needs: [ check-run ] |
| 36 | + if: needs.check-run.outputs.need-run == 'true' |
9 | 37 | name: Analyze |
10 | 38 | runs-on: ubuntu-latest |
11 | 39 |
|
|
35 | 63 | uses: github/codeql-action/analyze@v3 |
36 | 64 |
|
37 | 65 | rspec: |
38 | | - if: | |
39 | | - (contains(github.event.pull_request.labels.*.name, 'dependencies') && |
40 | | - contains(github.event.pull_request.labels.*.name, 'ruby') && |
41 | | - contains(github.event.pull_request.labels.*.name, 'tapioca-ready')) || ( |
42 | | - !contains(github.event.pull_request.labels.*.name, 'dependencies') && |
43 | | - !contains(github.event.pull_request.labels.*.name, 'ruby')) |
| 66 | + needs: [ check-run ] |
| 67 | + if: needs.check-run.outputs.need-run == 'true' |
44 | 68 | runs-on: ubuntu-20.04 |
45 | 69 | strategy: |
46 | 70 | fail-fast: false |
|
54 | 78 | run: bundle exec rspec |
55 | 79 |
|
56 | 80 | typecheck: |
57 | | - if: | |
58 | | - (contains(github.event.pull_request.labels.*.name, 'dependencies') && |
59 | | - contains(github.event.pull_request.labels.*.name, 'ruby') && |
60 | | - contains(github.event.pull_request.labels.*.name, 'tapioca-ready')) || ( |
61 | | - !contains(github.event.pull_request.labels.*.name, 'dependencies') && |
62 | | - !contains(github.event.pull_request.labels.*.name, 'ruby')) |
| 81 | + needs: [ check-run ] |
| 82 | + if: needs.check-run.outputs.need-run == 'true' |
63 | 83 | runs-on: ubuntu-20.04 |
64 | 84 | strategy: |
65 | 85 | fail-fast: false |
|
76 | 96 | run: bundle exec srb typecheck |
77 | 97 |
|
78 | 98 | rubocop: |
79 | | - if: | |
80 | | - (contains(github.event.pull_request.labels.*.name, 'dependencies') && |
81 | | - contains(github.event.pull_request.labels.*.name, 'ruby') && |
82 | | - contains(github.event.pull_request.labels.*.name, 'tapioca-ready')) || ( |
83 | | - !contains(github.event.pull_request.labels.*.name, 'dependencies') && |
84 | | - !contains(github.event.pull_request.labels.*.name, 'ruby')) |
| 99 | + needs: [ check-run ] |
| 100 | + if: needs.check-run.outputs.need-run == 'true' |
85 | 101 | runs-on: ubuntu-20.04 |
86 | 102 | strategy: |
87 | 103 | fail-fast: false |
|
0 commit comments