Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit 0610749

Browse files
authored
ci: Configure PR validation (#646)
1 parent b48513b commit 0610749

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

Diff for: .github/workflows/validate.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Validate
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
validate:
9+
strategy:
10+
matrix:
11+
version: [12, 14, 16, 18]
12+
os: [ubuntu-latest, windows-latest]
13+
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Retrieve dependencies from cache
20+
id: cacheNpm
21+
uses: actions/cache@v3
22+
with:
23+
path: |
24+
~/.npm
25+
node_modules
26+
key: npm-v${{ matrix.version }}-${{ matrix.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
27+
restore-keys: |
28+
npm-v${{ matrix.version }}-${{ matrix.os }}-${{ github.ref }}-
29+
npm-v${{ matrix.version }}-${{ matrix.os }}-refs/heads/master-
30+
31+
- name: Install Node.js and npm
32+
uses: actions/setup-node@v3
33+
with:
34+
node-version: ${{ matrix.version }}
35+
36+
- name: Install dependencies
37+
if: steps.cacheNpm.outputs.cache-hit != 'true'
38+
run: |
39+
npm ci
40+
41+
- name: Validate lint rules
42+
run: npm run lint
43+
44+
- name: Run tests
45+
run: npm run test:ci

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"lint:fix": "eslint src/**/*.ts --fix",
1313
"pretest": "npm run lint",
1414
"test": "jest",
15-
"test:ci": "npm run test -- --ci",
16-
"test:coverage": "npm run test -- --coverage",
15+
"test:ci": "npm run test:coverage -- --ci",
16+
"test:coverage": "npm run test -- --config ./jest.config.js",
1717
"clean:int": "rm -rf integrationTests/configurations/**/.serverless integrationTests/configurations/**/node_modules integrationTests/configurations/**/local.settings.json",
1818
"pretest:int": "npm run clean:int",
1919
"test:int": "clvr",

0 commit comments

Comments
 (0)