| 1 |
# PR's only |
| 2 |
|
| 3 |
name: Validate |
| 4 |
|
| 5 |
on: |
| 6 |
pull_request: |
| 7 |
branches: [main] |
| 8 |
|
| 9 |
env: |
| 10 |
FORCE_COLOR: 1 |
| 11 |
|
| 12 |
jobs: |
| 13 |
linuxNode16: |
| 14 |
name: "[Linux] Node.js v16: Lint, Formatting" |
| 15 |
runs-on: ubuntu-latest |
| 16 |
steps: |
| 17 |
- name: Checkout repository |
| 18 |
uses: actions/checkout@v2 |
| 19 |
|
| 20 |
- name: Retrieve dependencies from cache |
| 21 |
id: cacheNpm |
| 22 |
uses: actions/cache@v2 |
| 23 |
with: |
| 24 |
path: | |
| 25 |
~/.npm |
| 26 |
node_modules |
| 27 |
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} |
| 28 |
restore-keys: | |
| 29 |
npm-v16-${{ runner.os }}-${{ github.ref }}- |
| 30 |
npm-v16-${{ runner.os }}-refs/heads/main- |
| 31 |
|
| 32 |
- name: Install Node.js and npm |
| 33 |
uses: actions/setup-node@v1 |
| 34 |
with: |
| 35 |
node-version: 16.x |
| 36 |
|
| 37 |
- name: Install dependencies |
| 38 |
if: steps.cacheNpm.outputs.cache-hit != 'true' |
| 39 |
run: | |
| 40 |
npm update --no-save |
| 41 |
npm update --save-dev --no-save |
| 42 |
- name: Validate Prettier formatting |
| 43 |
run: npm run prettier-check:updated |
| 44 |
- name: Validate ESLint rules |
| 45 |
run: npm run lint:updated |