-
Notifications
You must be signed in to change notification settings - Fork 2
CI ワークフローの変更をMaiaから同期 #3449
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
Merged
The head ref may contain hidden characters: "feature/CI\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u306E\u5909\u66F4\u3092Maia\u304B\u3089\u540C\u671F"
Merged
CI ワークフローの変更をMaiaから同期 #3449
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fd3d90c
モノレポのルートプロジェクト直下のファイルをCIのフォーマット対象にする の内容を反映
KentaHizume 9d52350
[Dressca] フロントエンドCIでカバレッジを表示する の内容を同期
KentaHizume 5981616
Merge branch 'main' into feature/CIワークフローの変更をMaiaから同期
KentaHizume ede70ba
actions/setup-node 5 系の新機能でキャッシュする の変更を反映
KentaHizume 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 hidden or 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,74 @@ | ||
| name: coverage-to-markdown | ||
| description: Vitest の テストカバレッジファイル coverage-summary.json を jq で加工し、Markdown 形式の表に整形します。 | ||
|
|
||
| inputs: | ||
| coverage_json: | ||
| description: "入力となる coverage-summary.json のパス" | ||
| required: true | ||
| output_md: | ||
| description: "整形した Markdown を出力するファイルパス" | ||
| required: true | ||
| prefix: | ||
| description: "ファイル名のプレフィックス" | ||
| required: false | ||
| default: "" | ||
|
|
||
|
|
||
| outputs: | ||
| markdown_path: | ||
| description: "生成された Markdown ファイルのパス" | ||
| value: ${{ steps.set-outputs.outputs.markdown_path }} | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - id: coverage-to-md-by-jq | ||
| name: jq で Markdown を生成 | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail # エラーが出たら即終了、未定義変数の参照禁止、パイプライン中のエラー検知を設定します。 | ||
|
|
||
| COV_JSON="${{ inputs.coverage_json }}" | ||
| OUT_MD="${{ inputs.output_md }}" | ||
| PREFIX="${{ inputs.prefix }}" | ||
|
|
||
| mkdir -p "$(dirname "$OUT_MD")" # 出力対象ディレクトリが存在していなければ作成 | ||
|
|
||
| { | ||
| echo "" | ||
| echo "### サマリー" | ||
| echo "| 項目 | Covered/Total | % |" | ||
| echo "|---|---:|---:|" | ||
| jq -r ' | ||
| .total as $t | ||
| | ["lines","branches","functions","statements"] | ||
| | map(select($t[.] != null)) | ||
| | .[] | ||
| | "| \(.) | \($t[.].covered)/\($t[.].total) | \(($t[.].pct // 0))% |" | ||
| ' "$COV_JSON" | ||
| echo "" | ||
| echo "### ファイルごとの詳細" | ||
| echo "| ファイル | Lines (c/t, %) | Branches (c/t, %) | Functions (c/t, %) | Statements (c/t, %) |" | ||
| echo "|---|---:|---:|---:|---:|" | ||
| jq -r --arg prefix "$PREFIX" ' | ||
| to_entries | ||
| | map(select(.key != "total")) | ||
| | sort_by(.key) | ||
| | .[] | ||
| | .key as $file | ||
| | .value as $v | ||
| | "| \( | ||
| $file | ||
| | gsub("^" + $prefix; "") # ファイル名が長くなるので prefix を除去します。 | ||
| )" | ||
| + " | \($v.lines.covered)/\($v.lines.total), \(($v.lines.pct // 0))%" | ||
| + " | \($v.branches.covered)/\($v.branches.total), \(($v.branches.pct // 0))%" | ||
| + " | \($v.functions.covered)/\($v.functions.total), \(($v.functions.pct // 0))%" | ||
| + " | \($v.statements.covered)/\($v.statements.total), \(($v.statements.pct // 0))% |" | ||
| ' "$COV_JSON" | ||
| } > "$OUT_MD" | ||
| - id: set-outputs | ||
| name: 出力変数名をセット | ||
| shell: bash | ||
| run: | | ||
| echo "markdown_path=${{ inputs.output_md }}" >> "$GITHUB_OUTPUT" |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,45 @@ | ||
| --- | ||
|
|
||
| name: dressca-root-frontend CI | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - 'samples/Dressca/dressca-frontend/*.*' | ||
| - '.github/workflows/samples-dressca-root-frontend-ci.yml' | ||
| workflow_dispatch: | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: samples/Dressca/dressca-frontend/ | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Dressca モノレポのルートプロジェクトのチェック | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| NO_COLOR: "1" # 文字化け防止のためカラーコードを出力しない | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - name: Use Node.js LTS | ||
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | ||
| with: | ||
| node-version: lts/* | ||
| # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
| cache: npm | ||
| - name: node パッケージのインストール | ||
| run: npm ci | ||
| - id: run-format | ||
| name: format の実行 | ||
| run: npm run format:ci:root >> /var/tmp/format-result.txt 2>&1 | ||
|
|
||
| - name: format の結果出力 | ||
| if: ${{ success() || (failure() && steps.run-format.conclusion == 'failure') }} | ||
| uses: ./.github/workflows/file-to-summary | ||
| with: | ||
| body: /var/tmp/format-result.txt | ||
| header: 'format の結果 :pen:' |
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.
Uh oh!
There was an error while loading. Please reload this page.