Skip to content
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
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,31 @@ concurrency:
cancel-in-progress: true

jobs:
# Detect whether non-markdown files changed so the heavy check job can be
# skipped for documentation-only PRs while still reporting a green status.
changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
src:
- '**/*'
- '!**/*.md'
- '!.github/workflows/docs.yml'

check:
name: Typecheck / Lint / Test / Build
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand Down Expand Up @@ -64,3 +87,19 @@ jobs:
# produced at release time and committed onto the tag), so there is no
# freshness check here.
- run: pnpm run build

# Bridge job that always succeeds so branch protection can require it even
# when the real check job is skipped for markdown-only changes.
check-gate:
name: Typecheck / Lint / Test / Build (gate)
needs: [changes, check]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check passed or skipped
if: ${{ needs.check.result == 'success' || needs.check.result == 'skipped' }}
run: echo "CI check passed or skipped (markdown-only changes)."

- name: Check failed
if: ${{ needs.check.result == 'failure' }}
run: exit 1
25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Docs

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
typos:
name: Typo check
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- uses: crate-ci/typos@b1a1ef3893ff35ade0cfa71523852a49bfd05d19 # v1.31.1
47 changes: 47 additions & 0 deletions .github/workflows/self-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,31 @@ concurrency:
cancel-in-progress: true

jobs:
# Detect whether non-markdown files changed so the heavy matrix jobs can be
# skipped for documentation-only PRs while still reporting a green status.
changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
src:
- '**/*'
- '!**/*.md'
- '!.github/workflows/docs.yml'

matrix:
name: ${{ matrix.os }} / version=${{ matrix.version }}
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
Expand Down Expand Up @@ -86,6 +109,8 @@ jobs:

skip-checksum:
name: Install with skip-checksum
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand All @@ -110,3 +135,25 @@ jobs:
version: "3.51.1"
skip-checksum: "true"
- run: task --version

# Bridge job that always succeeds so branch protection can require it even
# when the real self-test jobs are skipped for markdown-only changes.
self-test-gate:
name: Self-test (gate)
needs: [changes, matrix, skip-checksum]
if: always()
runs-on: ubuntu-latest
steps:
- name: Self-test passed or skipped
if: ${{
(needs.matrix.result == 'success' || needs.matrix.result == 'skipped') &&
(needs.skip-checksum.result == 'success' || needs.skip-checksum.result == 'skipped')
}}
run: echo "Self-test passed or skipped (markdown-only changes)."

- name: Self-test failed
if: ${{
needs.matrix.result == 'failure' ||
needs.skip-checksum.result == 'failure'
}}
run: exit 1
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@

| # | 概要 | 優先度 | ラベル | 備考 |
|---|---|---|---|---|
| [#8](https://github.com/yk-lab/setup-task/issues/8) | `[ci]` Codecov でカバレッジを PR 表示 | `P3: low` | `ci` `test` | reopen。`pull-requests: write` 追加 + `codecov.yml` 調整済み。PR コメント表示を確認 |
| [#39](https://github.com/yk-lab/setup-task/issues/39) | `[enhancement]` ジョブサマリに導入結果を出力(NFR-5) | `P3: low` | `enhancement` |
| [#40](https://github.com/yk-lab/setup-task/issues/40) | `[enhancement]` リトライ回数・間隔を input 化(FR-4) | `P3: low` | `enhancement` |
| [#41](https://github.com/yk-lab/setup-task/issues/41) | `[test]` platform.test.ts を §9 全 os/arch 組合せに拡張 | `P3: low` | `test` |
Expand All @@ -70,6 +69,7 @@ v1.0.0 実装中に作成・解決済みの Issue(参考)。

| # | 概要 | 解決 PR(推定) |
|---|---|---|
| [#8](https://github.com/yk-lab/setup-task/issues/8) | `[ci]` Codecov でカバレッジを PR 表示 | #46 / #47 |
| [#1](https://github.com/yk-lab/setup-task/issues/1) | `[security]` `repo-token` を `core.setSecret` で秘匿 | #24 |
| [#2](https://github.com/yk-lab/setup-task/issues/2) | `[test]` `withRetry` のユニットテスト | #25 |
| [#3](https://github.com/yk-lab/setup-task/issues/3) | `[test]` `fetchJson` content-type ガードのテスト | #26 |
Expand Down
Loading