Skip to content

Commit 717f736

Browse files
ci: lint, build and storybook
1 parent 8449180 commit 717f736

File tree

4 files changed

+51
-52
lines changed

4 files changed

+51
-52
lines changed

.github/workflows/build.yml

+5-34
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Chromatic"
1+
name: "Build"
22

33
on:
44
push:
@@ -13,9 +13,9 @@ on:
1313
- 'astro.config.mjs'
1414
workflow_dispatch:
1515
inputs:
16-
my_input:
16+
title:
1717
description: 'testing e2e'
18-
required: true
18+
required: false
1919

2020
jobs:
2121
install:
@@ -25,43 +25,14 @@ jobs:
2525
discussions: write
2626
runs-on: ubuntu-latest
2727
steps:
28-
- name: Checkout code
29-
uses: actions/checkout@v4
30-
with:
31-
fetch-depth: 0
32-
- name: Install pnpm
33-
uses: pnpm/action-setup@v4
34-
with:
35-
version: 9
36-
- name: Use Node.js ${{ matrix.node-version }}
37-
uses: actions/setup-node@v4
38-
with:
39-
node-version: ${{ matrix.node-version }}
40-
cache: 'pnpm'
41-
- name: Install dependencies
42-
run: pnpm install
43-
build:
44-
name: Build Project
45-
needs: install
46-
runs-on: ubuntu-latest
47-
steps:
28+
- name: linter
29+
uses: ./.github/workflows/lint.yml
4830
- name: build blogger template
4931
run: pnpm build
50-
- name: build storybook
51-
run: pnpm build-storybook
52-
- uses: montudor/action-zip@v1
53-
with:
54-
args: zip -qq -r storybook-static.zip storybook-static
55-
released:
56-
name: Released Project
57-
needs: build
58-
runs-on: ubuntu-latest
59-
steps:
6032
- name: Release with Notes
6133
uses: softprops/action-gh-release@v2
6234
with:
6335
files: |
6436
dist/blogger.xml
65-
storybook-static.zip
6637
env:
6738
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/chromatic.yml

+15-17
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
paths:
66
- 'src/view/**'
7+
- '.github/workflows/chromatic.yml'
78
workflow_dispatch:
89
inputs:
910
my_input:
@@ -15,23 +16,20 @@ jobs:
1516
name: Run Chromatic
1617
runs-on: ubuntu-latest
1718
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v4
20-
with:
21-
fetch-depth: 0
22-
- name: Install pnpm
23-
uses: pnpm/action-setup@v4
24-
with:
25-
version: 9
26-
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v4
28-
with:
29-
node-version: ${{ matrix.node-version }}
30-
cache: 'pnpm'
31-
- name: Install dependencies
32-
run: pnpm install
19+
- name: linter
20+
uses: ./.github/workflows/lint.yml
3321
- name: Run Chromatic
3422
uses: chromaui/action@latest
3523
with:
36-
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret
37-
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
24+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
25+
exitOnceUploaded: true
26+
onlyChanged: true
27+
traceChanged: true
28+
diagnostics: true
29+
skip: ${{ github.event.pull_request.draft == true }}
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
name: chromatic-build-artifacts-${{ github.run_id }}
33+
path: |
34+
chromatic-diagnostics.json
35+
**/build-storybook.log

.github/workflows/lint.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Lint code"
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '!src/view/**'
7+
- 'src/**/*.ts'
8+
workflow_call:
9+
10+
jobs:
11+
check:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Install pnpm
19+
uses: pnpm/action-setup@v4
20+
with:
21+
version: 9
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'pnpm'
27+
- name: Install dependencies
28+
run: pnpm install
29+
- name: eslint
30+
run: pnpm lint

.github/workflows/pagespeed.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Chromatic"
1+
name: "Pagespeed"
22

33
on:
44
workflow_dispatch:

0 commit comments

Comments
 (0)