ci: Improve the test file check workflow (#18741)
This commit is contained in:
parent
f3e37b9d1e
commit
5542d12123
19
.github/workflows/pr-labeler.yml
vendored
19
.github/workflows/pr-labeler.yml
vendored
|
|
@ -12,21 +12,4 @@ jobs:
|
|||
steps:
|
||||
- uses: appsmithorg/labeler@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
- name: Get changed files using defaults
|
||||
id: changed-files
|
||||
uses: trilom/file-changes-action@v1.2.3
|
||||
continue-on-error: true
|
||||
|
||||
- name: Run step when a file changes
|
||||
uses: actions-ecosystem/action-create-comment@v1
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: |
|
||||
contains(steps.changed-files.outputs.files_modified, 'cypress') == false &&
|
||||
contains(steps.changed-files.outputs.files_modified, 'test') == false
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
body: |
|
||||
Unable to find test scripts. Please add necessary tests to the PR.
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
33
.github/workflows/pr-test-file-check.yml
vendored
Normal file
33
.github/workflows/pr-test-file-check.yml
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
name: Check for test files
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ release ]
|
||||
types: [ opened, reopened, edited ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Get changed files using defaults
|
||||
id: changed-files
|
||||
uses: trilom/file-changes-action@v1.2.3
|
||||
continue-on-error: true
|
||||
|
||||
- name: Ger labels of the PR
|
||||
id: labels
|
||||
uses: joerick/pr-labels-action@v1.0.6
|
||||
continue-on-error: true
|
||||
|
||||
- name: Comment if test files not found
|
||||
uses: actions-ecosystem/action-create-comment@v1
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: |
|
||||
contains(fromJson('["cypress", "test"]'), toJson(steps.changed-files.outputs.files_modified)) == false &&
|
||||
contains(fromJson('["Bug", "Enhancement", "Pod"]'), toJson(steps.labels.outputs.labels)) == true
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
body: |
|
||||
Unable to find test scripts. Please add necessary tests to the PR.
|
||||
Loading…
Reference in New Issue
Block a user