Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
36 changes: 24 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint & build
name: Lint & test & build

on:
push:
Expand Down Expand Up @@ -36,19 +36,31 @@ on:
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
id: setup-node
with:
node-version: ${{ matrix.node-version }}
node-version-file: ".nvmrc"
cache: "npm"
- run: npm ci

- id: node-modules-cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-node_modules-

- if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci

- run: npm run lint
- run: npm run test -- --bail
- run: npm run build:prod

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
35 changes: 24 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish release
name: Lint & test & build & publish release

# Controls when the workflow will run
on:
Expand All @@ -16,26 +16,39 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
id: setup-node
with:
cache: npm
node-version-file: ".nvmrc"
- run: npm ci
cache: "npm"

- id: node-modules-cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-node_modules-

- if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci

- run: npm run lint
- run: npm run test -- --bail
- run: npm run build:prod:web

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build
path: dist/

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: nginx-config
path: nginx.conf.template

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dockerfile
path: Dockerfile
Expand All @@ -46,16 +59,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build
path: dist

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: nginx-config

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: dockerfile

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
coverage/
dist/
node_modules/
storybook-static/
.DS_Store
.eslintcache
.eslintcache
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dbaeumer.vscode-eslint",
"davidanson.vscode-markdownlint",
"esbenp.prettier-vscode",
"Orta.vscode-jest",
"stylelint.vscode-stylelint",
"styled-components.vscode-styled-components",
"streetsidesoftware.code-spell-checker"
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
"udemy",
"undismiss",
"zustand"
]
],
"jest.runMode": "on-demand"
}
17 changes: 17 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { createDefaultPreset, type JestConfigWithTsJest } from "ts-jest";

const jestConfig: JestConfigWithTsJest = {
coverageDirectory: "coverage",
coverageReporters: ["text-summary", "html"],
collectCoverageFrom: [
"src/**/*.{ts,tsx}",
"!src/**/*.stories.tsx",
"!src/**/*.d.ts"
],
testEnvironment: "jsdom",
transform: {
...createDefaultPreset().transform
}
};

export default jestConfig;
Loading