Merge pull request #2519 from IntersectMBO/feat/integrate-matomo #1574
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Frontend Test, Lint & Type Check | |
on: | |
push: | |
paths: | |
- govtool/frontend/** | |
- .github/workflows/code_check_frontend.yml | |
defaults: | |
run: | |
working-directory: govtool/frontend | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: govtool/frontend/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('govtool/frontend/package-lock.json') }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
registry-url: "https://registry.npmjs.org/" | |
node-version-file: "./govtool/frontend/.nvmrc" | |
scope: "@intersect.mbo" | |
- run: npm ci | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMRC_TOKEN }} | |
- name: π§ͺ Test | |
run: | | |
npm run test | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: govtool/frontend/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('govtool/frontend/package-lock.json') }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
registry-url: "https://registry.npmjs.org/" | |
node-version-file: "./govtool/frontend/.nvmrc" | |
scope: "@intersect.mbo" | |
- run: npm ci | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMRC_TOKEN }} | |
- name: π Lint | |
run: | | |
npm run lint | |
type_check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: govtool/frontend/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('govtool/frontend/package-lock.json') }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
registry-url: "https://registry.npmjs.org/" | |
node-version-file: "./govtool/frontend/.nvmrc" | |
scope: "@intersect.mbo" | |
- run: npm ci | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMRC_TOKEN }} | |
- name: π Type Check | |
run: | | |
npm run tsc |