| 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 |
linuxNode14: |
| 14 |
name: "[Linux] Node.js v14: Lint, Formatting, Unit tests" |
| 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-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} |
| 28 |
restore-keys: | |
| 29 |
npm-v14-${{ runner.os }}-${{ github.ref }}- |
| 30 |
npm-v14-${{ runner.os }}-refs/heads/main- |
| 31 |
|
| 32 |
- name: Install Node.js and npm |
| 33 |
uses: actions/setup-node@v1 |
| 34 |
with: |
| 35 |
node-version: 14.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 |
| 46 |
- name: Unit tests |
| 47 |
run: npm test -- -b |
| 48 |
|
| 49 |
windowsNode14: |
| 50 |
name: "[Windows] Node.js v14: Unit tests" |
| 51 |
runs-on: windows-latest |
| 52 |
steps: |
| 53 |
- name: Checkout repository |
| 54 |
uses: actions/checkout@v2 |
| 55 |
|
| 56 |
- name: Retrieve dependencies from cache |
| 57 |
id: cacheNpm |
| 58 |
uses: actions/cache@v2 |
| 59 |
with: |
| 60 |
path: | |
| 61 |
~/.npm |
| 62 |
node_modules |
| 63 |
key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} |
| 64 |
restore-keys: | |
| 65 |
npm-v14-${{ runner.os }}-${{ github.ref }}- |
| 66 |
npm-v14-${{ runner.os }}-refs/heads/main- |
| 67 |
|
| 68 |
- name: Install Node.js and npm |
| 69 |
uses: actions/setup-node@v1 |
| 70 |
with: |
| 71 |
node-version: 14.x |
| 72 |
|
| 73 |
- name: Install dependencies |
| 74 |
if: steps.cacheNpm.outputs.cache-hit != 'true' |
| 75 |
run: | |
| 76 |
npm update --no-save |
| 77 |
npm update --save-dev --no-save |
| 78 |
- name: Unit tests |
| 79 |
run: npm test -- -b |
| 80 |
|
| 81 |
linuxNode16: |
| 82 |
name: "[Linux] Node.js 16: Unit tests" |
| 83 |
runs-on: ubuntu-latest |
| 84 |
steps: |
| 85 |
- name: Checkout repository |
| 86 |
uses: actions/checkout@v2 |
| 87 |
|
| 88 |
- name: Retrieve dependencies from cache |
| 89 |
id: cacheNpm |
| 90 |
uses: actions/cache@v2 |
| 91 |
with: |
| 92 |
path: | |
| 93 |
~/.npm |
| 94 |
node_modules |
| 95 |
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} |
| 96 |
restore-keys: | |
| 97 |
npm-v16-${{ runner.os }}-${{ github.ref }}- |
| 98 |
npm-v16-${{ runner.os }}-refs/heads/main- |
| 99 |
|
| 100 |
- name: Install Node.js and npm |
| 101 |
uses: actions/setup-node@v1 |
| 102 |
with: |
| 103 |
node-version: 16.x |
| 104 |
|
| 105 |
- name: Install dependencies |
| 106 |
if: steps.cacheNpm.outputs.cache-hit != 'true' |
| 107 |
run: | |
| 108 |
npm update --no-save |
| 109 |
npm update --save-dev --no-save |
| 110 |
- name: Unit tests |
| 111 |
run: npm run test -- -b |
| 112 |
|
| 113 |
linuxNode12: |
| 114 |
name: "[Linux] Node.js v12: Unit tests with coverage" |
| 115 |
runs-on: ubuntu-latest |
| 116 |
steps: |
| 117 |
- name: Checkout repository |
| 118 |
uses: actions/checkout@v2 |
| 119 |
|
| 120 |
- name: Retrieve dependencies from cache |
| 121 |
id: cacheNpm |
| 122 |
uses: actions/cache@v2 |
| 123 |
with: |
| 124 |
path: | |
| 125 |
~/.npm |
| 126 |
node_modules |
| 127 |
key: npm-v12-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} |
| 128 |
restore-keys: | |
| 129 |
npm-v12-${{ runner.os }}-${{ github.ref }}- |
| 130 |
npm-v12-${{ runner.os }}-refs/heads/main- |
| 131 |
|
| 132 |
- name: Install Node.js and npm |
| 133 |
uses: actions/setup-node@v1 |
| 134 |
with: |
| 135 |
node-version: 12.x |
| 136 |
|
| 137 |
- name: Install dependencies |
| 138 |
if: steps.cacheNpm.outputs.cache-hit != 'true' |
| 139 |
run: | |
| 140 |
npm update --no-save |
| 141 |
npm update --save-dev --no-save |
| 142 |
- name: Unit tests |
| 143 |
run: npm run coverage |
| 144 |
- name: Push coverage |
| 145 |
run: npx codecov |