Skip to content

Commit

Permalink
Merge pull request #513 from IntersectMBO/chore/512-add-eslint-tsc-an…
Browse files Browse the repository at this point in the history
…d-prettier-to-github-actions

[#512] chore: add type checking & lint workflow to github actions
  • Loading branch information
MSzalowski committed Mar 20, 2024
2 parents 3d2b76d + 7a5d234 commit c9e8c54
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 31 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/code_check_frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Frontend Test, Lint & Type Check

on:
push:
paths:
- govtool/frontend/**
- .github/workflows/test_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:
node-version-file: "govtool/frontend/.nvmrc"

- name: 🧪 Test
run: |
npm install
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:
node-version-file: "govtool/frontend/.nvmrc"

- name: 👕 Lint
run: /
npm install
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:
node-version-file: "govtool/frontend/.nvmrc"

- name: 🔍 Type Check
run: /
npm install
npm run tsc
31 changes: 0 additions & 31 deletions .github/workflows/test_frontend.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ changes.
- Add hash and validation of the metadata [Issue 378](https://github.com/IntersectMBO/govtool/issues/378)
- Add githubusercontent.com and ipfs.io to content security policy header [Issue 451](https://github.com/IntersectMBO/govtool/issues/451)
- Add frontend test workflow on github actions [Issue 500](https://github.com/IntesectMBO/govtool/issues/500)
- Add type check & lint to github actions [Issue 512](https://github.com/IntesectMBO/govtool/issues/512)

### Added

Expand Down
1 change: 1 addition & 0 deletions govtool/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "vite",
"build": "vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"tsc": "npx tsc --noEmit --skipLibCheck",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
Expand Down

0 comments on commit c9e8c54

Please sign in to comment.