-
Notifications
You must be signed in to change notification settings - Fork 12
43 lines (37 loc) · 1.38 KB
/
pull-request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Pull Request
on:
pull_request:
branches: '*'
jobs:
check-changes:
runs-on: ubuntu-latest
name: Check Changed Files
outputs:
modules: ${{ steps.build-matrix.outputs.modules }}
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
with:
files: packages/**
# Optionally set `files_yaml_from_source_file` to read the YAML from a file. e.g `files_yaml_from_source_file: .github/changed-files.yml`
- name: Run step if test file(s) change
# NOTE: Ensure all outputs are prefixed by the same key used above e.g. `test_(...)` | `doc_(...)` | `src_(...)` when trying to access the `any_changed` output.
if: steps.changed-files.outputs.any_changed == 'true'
env:
TEST_ALL_CHANGED_FILES: ${{ steps.changed-files-yaml.outputs.test_all_changed_files }}
run: |
echo "One or more test file(s) has changed."
echo "List all the files that have changed: $TEST_ALL_CHANGED_FILES"
trigger-lint:
name: Run Lint Checks
uses: ./.github/workflows/lint.yml
trigger-unit-test:
name: Run Unit Tests
permissions:
pull-requests: write
needs: [ check-changes ]
if: steps.changed-files.outputs.any_changed == 'true'
uses: ./.github/workflows/unit-test.yml
secrets: inherit