This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Merged
CIの追加 #7
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
cff92fe
deps: install biome
claustra01 7371f57
fix: biome check error
claustra01 68fd2da
add: lint and check ci
claustra01 3155ca9
fix: yaml format
claustra01 dc0be66
deps: install cspell
claustra01 ff90deb
add: spell and build ci
claustra01 285689a
chore: add job needs
claustra01 096469d
chore: add \n
claustra01 c16d724
add: lighthouse ci
claustra01 ed0ba0a
fix: firebase.json
claustra01 6955bf0
fix: lighthouse deploy ci
claustra01 0d516d9
add: lighthouse ci
claustra01 5c965cf
add: analyze ci
claustra01 f050a7e
chore: remove ci deps
claustra01 5ad07e3
fix: ci permissions
claustra01 f516a1c
fix: lighthouse check url
claustra01 b504238
fix: lighthouse ci
claustra01 32d999f
fix: ci permission
claustra01 949b42c
add: visualizer ci
claustra01 aac2ec0
chore: yaml padding
claustra01 a0a695a
fix: visualizer ci
claustra01 c3d2b01
fix: publish branch
claustra01 ab5b663
test
claustra01 c469887
test
claustra01 19d1cfd
test
claustra01 b63ab38
test
claustra01 ab80dc4
test
claustra01 c3c4673
test
claustra01 34a2f26
test
claustra01 3c48ea2
test
claustra01 e68e902
test
claustra01 d2b6707
test
claustra01 43a4861
test
claustra01 a1973a1
chore: ci update comment
claustra01 7137135
fix: lighthouse ci body
claustra01 7301d19
test
claustra01 0c4c2c1
fix: replace comment
claustra01 3b12cc6
test
claustra01 e0d89d5
test
claustra01 cbfe8d9
test
claustra01 3d46a2e
test
claustra01 03b77ce
test
claustra01 c77f122
add: update visualizer comment
claustra01 eb92680
fix: update comment issue number
claustra01 1c734a2
test
claustra01 0dc0cac
deps: pin node version
claustra01 c381971
add: ci condition
claustra01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
npm install | ||
npm run check:ci | ||
|
||
spell: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
npm install | ||
npm run spell | ||
|
||
build: | ||
needs: [check, spell] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
npm install | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: pr-lighthouse | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
checks: write | ||
pull-requests: write | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
npm install | ||
npm run build | ||
|
||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
with: | ||
repoToken: ${{ secrets.GITHUB_TOKEN }} | ||
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_VIRTUAL_NATSUMATSURI }} | ||
channelId: live | ||
projectId: virtual-natsumatsuri | ||
|
||
lighthouse: | ||
needs: deploy | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Lighthouse CI | ||
uses: treosh/lighthouse-ci-action@v10 | ||
id: lighthouse | ||
with: | ||
uploadArtifacts: true | ||
temporaryPublicStorage: true | ||
urls: https://virtual-natsumatsuri.web.app/ | ||
|
||
- name: Get Comment Body | ||
uses: actions/github-script@v5 | ||
id: get-comment-body | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const results = ${{ steps.lighthouse.outputs.manifest }} | ||
const links = ${{ steps.lighthouse.outputs.links }} | ||
const mark = (value) => { | ||
if (value >= 0.9) { | ||
return '🟢'; | ||
} else if (value >= 0.5) { | ||
return '🟡'; | ||
} else { | ||
return '🔴'; | ||
} | ||
}; | ||
const body = ` | ||
# Lighthouse Report | ||
| URL | Performance | Accessibility | Best Practices | SEO | PWA | Details | | ||
| --- | ----------- | ------------- | -------------- | --- | --- | ------- | | ||
${results.map((result) => `| ${result.url} | ${mark(result.summary.performance)}${Math.trunc(result.summary.performance * 100)} | ${mark(result.summary.accessibility)}${Math.trunc(result.summary.accessibility * 100)} | ${mark(result.summary['best-practices'])}${Math.trunc(result.summary['best-practices'] * 100)} | ${mark(result.summary.seo)}${Math.trunc(result.summary.seo * 100)} | ${mark(result.summary.pwa)}${Math.trunc(result.summary.pwa * 100)} | :pencil: [result](${links[result.url]}) |`).join('\n')} | ||
`; | ||
core.setOutput("body", body) | ||
|
||
- name: Find Comment | ||
uses: peter-evans/find-comment@v2 | ||
if: success() && github.event.number | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
includes-comment: "# Lighthouse Report" | ||
|
||
- name: Create Comment | ||
uses: peter-evans/create-or-update-comment@v2 | ||
if: success() && github.event.number && steps.fc.outputs.comment-id == 0 | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
body: ${{ steps.get-comment-body.outputs.body }} | ||
|
||
- name: Update Comment | ||
uses: peter-evans/create-or-update-comment@v2 | ||
if: success() && github.event.number && steps.fc.outputs.comment-id != 0 | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
body: ${{ steps.get-comment-body.outputs.body }} | ||
edit-mode: replace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: pr-visualizer | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
visualizer: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install and Build | ||
run: | | ||
npm install | ||
npm run build | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./dist/visualizer/ | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: actions/deploy-pages@v4 | ||
id: deployment | ||
with: | ||
branch: ${{ github.head_ref }} | ||
|
||
- name: Find existing comment | ||
uses: peter-evans/find-comment@v2 | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
body-includes: '# Visualizer Report' | ||
|
||
- name: Create comment | ||
uses: peter-evans/create-or-update-comment@v2 | ||
if: success() && github.event.number && steps.fc.outputs.comment-id == 0 | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
body: | | ||
# Visualizer Report | ||
You can view the results [here](${{ steps.deployment.outputs.page_url }}). | ||
|
||
- name: Update comment | ||
uses: peter-evans/create-or-update-comment@v2 | ||
if: success() && github.event.number && steps.fc.outputs.comment-id != 0 | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
body: | | ||
# Visualizer Report | ||
You can view the results [here](${{ steps.deployment.outputs.page_url }}). | ||
edit-mode: replace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"ignorePaths": ["node_modules/**", "*.svg"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pnpmのプロジェクトならCIでもnpm使うのが一般的では?
pnpmは依存の解決が他とちょっと違うから、そこまで担保できているか不安
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pnpmに変えたら全部落ちたが
voltaでpnpm使ってる(voltaのpnpmはまだbeta)からだと思われ