Skip to content

Commit

Permalink
Merge pull request #31 from danskernesdigitalebibliotek/DDFBRA-164-cr…
Browse files Browse the repository at this point in the history
…eate-gh-action-to-run-yarn-build-on-every-pr

feat: add build test workflow for pull requests
  • Loading branch information
ThomasGross authored Nov 5, 2024
2 parents 054fe5c + 0b9533a commit cc7b1e5
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 3 deletions.
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

- 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

- 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__"
]
}

0 comments on commit cc7b1e5

Please sign in to comment.