Skip to content

Commit a14e08f

Browse files
author
Gusted
authored
Move code-related CI tests (#8509)
- Don't run code-related CI tests when only a config is changed. Move the code-related CI tests to it's own workflow, which only run when a non-config path has been changed. Similar how test-browser.yml operates.
1 parent 8bc7854 commit a14e08f

3 files changed

Lines changed: 57 additions & 8 deletions

File tree

.github/workflows/test-browser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Run browser tests in Karma
22
on:
33

44
# Runs for pushes and pull requests,
5-
# but if changes are config-only
5+
# but don't run these when only some config is changed.
66
push:
77
branches:
88
- master

.github/workflows/test-code.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Run code tests on Pull Request or Push
2+
on:
3+
4+
# Runs for pushes and pull requests,
5+
# but don't run these when only some config is changed.
6+
push:
7+
branches:
8+
- master
9+
paths-ignore:
10+
- 'src/config/*'
11+
pull_request:
12+
branches:
13+
- master
14+
types:
15+
- opened
16+
- synchronize
17+
- reopened
18+
- ready_for_review
19+
paths-ignore:
20+
- 'src/config/**'
21+
22+
workflow_dispatch:
23+
jobs:
24+
test:
25+
name: Run tests
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Clone repository
29+
uses: actions/checkout@v2
30+
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v2
33+
with:
34+
node-version: 15.x
35+
36+
- name: Verify NPM version
37+
run: npm --version
38+
39+
- name: Set up npm cache
40+
uses: actions/cache@v2
41+
with:
42+
path: ~/.npm
43+
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}
44+
restore-keys: |
45+
${{ runner.OS }}-${{ hashFiles('package-lock.json') }}
46+
${{ runner.OS }}
47+
48+
- name: Install npm dependencies
49+
run: npm ci
50+
51+
- name: Lint code for code-style errors
52+
run: npm run lint
53+
54+
- name: Check for compatibility issues
55+
run: npm run lint:bundle

.github/workflows/test.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run tests on Pull Request or Push
1+
name: Run config tests on Pull Request or Push
22
on:
33
push:
44
branches:
@@ -42,9 +42,3 @@ jobs:
4242

4343
- name: Run test against code
4444
run: npm run test:ci
45-
46-
- name: Lint code for code-style errors
47-
run: npm run lint
48-
49-
- name: Check for compatibility issues
50-
run: npm run lint:bundle

0 commit comments

Comments
 (0)