Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add build test workflow for pull requests #31

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions .github/workflows/eslint-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Eslint check

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Make sure the actual branch is checked out when running on pull requests.
ref: ${{ github.head_ref }}
fetch-depth: 0 # 👈 Required to retrieve git history

- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Install dependencies
run: yarn install --frozen-lockfile
Comment on lines +27 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to run install before lint checking? If not it would be nice to reduce the time running this.


- name: Lint Javascripts
run: yarn lint
31 changes: 31 additions & 0 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Type check

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Make sure the actual branch is checked out when running on pull requests.
ref: ${{ github.head_ref }}
fetch-depth: 0 # 👈 Required to retrieve git history

- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Install dependencies
run: yarn install --frozen-lockfile
Comment on lines +27 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to run install before type checking? If not it would be nice to reduce the time running this.


- name: Run typescript compile check
run: npx tsc --noEmit
4 changes: 2 additions & 2 deletions components/shared/button/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Decorator, Meta, StoryObj } from "@storybook/react"
import type { Meta, StoryObj } from "@storybook/react"
import { fn } from "@storybook/test"

import { darkModeDecorator } from "@/.storybook/decorators"
Expand Down Expand Up @@ -31,7 +31,7 @@ export const Default: Story = {
variant: "default",
size: "default",
},
render: (args, context) => {
render: args => {
return (
<Button {...args} onClick={fn()}>
Prøv Lydbogen
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"lib/rest/cover-service-api/model",
"lib/rest/cover-service-api/cover-service.ts",
"lib/graphql/generated/fbi/*.tsx",
"__tests__/"
"__tests__"
]
}