-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (43 loc) · 1.39 KB
/
test.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
44
45
46
47
48
49
50
51
name: Tests
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 1
- name: Setup Node
uses: actions/setup-node@v4.0.2
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install Dependencies
run: npm run setup
- name: Run Tests
run: npm run test:ci
- name: Get changed files
id: changed_files
uses: tj-actions/changed-files@v45
with:
sha: ${{ github.event.pull_request.head.sha }}
- name: Filter changed files for schema validation
id: filter_changed_files
run: |
CHANGED_FILES="${{ steps.changed_files.outputs.all_changed_files }}"
FILES_TO_VALIDATE=$(echo "$CHANGED_FILES" | tr ' ' '\n' | grep -v "src/configurations/sources" || true)
FILES_TO_VALIDATE=$(echo "$FILES_TO_VALIDATE" | tr '\n' ' ')
echo "files_to_validate=$FILES_TO_VALIDATE" >> $GITHUB_ENV
- name: Output Filtered files (remove later after sanity)
run: echo $files_to_validate
- name: Run schema validation for changed files
run: |
chmod +x scripts/run-schema-validation.sh
scripts/run-schema-validation.sh $files_to_validate