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

adding validate github action to pull requests raised to the master branch #646

Merged
merged 3 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Validate

on:
pull_request:
branches: [master]

jobs:
validate:
strategy:
matrix:
version: [12, 14, 16, 18]
os: [ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Retrieve dependencies from cache
id: cacheNpm
uses: actions/cache@v3
with:
path: |
~/.npm
node_modules
key: npm-v${{ matrix.version }}-${{ matrix.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
restore-keys: |
npm-v${{ matrix.version }}-${{ matrix.os }}-${{ github.ref }}-
npm-v${{ matrix.version }}-${{ matrix.os }}-refs/heads/master-

- name: Install Node.js and npm
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}

- name: Install dependencies
if: steps.cacheNpm.outputs.cache-hit != 'true'
run: |
npm ci

- name: Validate lint rules
run: npm run lint

- name: Run tests
run: npm run test:ci
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"lint:fix": "eslint src/**/*.ts --fix",
"pretest": "npm run lint",
"test": "jest",
"test:ci": "npm run test -- --ci",
"test:coverage": "npm run test -- --coverage",
"test:ci": "npm run test:coverage -- --ci",
"test:coverage": "npm run test -- --config ./jest.config.js",
"clean:int": "rm -rf integrationTests/configurations/**/.serverless integrationTests/configurations/**/node_modules integrationTests/configurations/**/local.settings.json",
"pretest:int": "npm run clean:int",
"test:int": "clvr",
Expand Down