Actions Ci Tuningのロゴ

Actions Ci Tuning

コミュニティ
mizchi
actions-ci-tuning

プロジェクトのGitHub Actionsワークフローを監査または改善するときに使用します。キャッシュの設定(npm/pnpm/yarn)、ジョブの並列化、シャード単位のテスト分割、アーティファクト処理の落とし穴、Playwright固有のパターンを扱います。CIの遅延、キャッシュミス、不安定なシャードジョブ、merge-reportsの失敗、「tune CI」という明示的な依頼に反応して起動します。

概要

公開者mizchi
リポジトリskills
スキル名actions-ci-tuning
スター
333
フォーク
4
同梱ファイル
指示のみ
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    mizchiがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Actions Ci Tuning」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/mizchi/skills/tree/main/actions-ci-tuning
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mizchi/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/actions-ci-tuning .claude/skills/actions-ci-tuning
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでActions Ci Tuningを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にActions Ci Tuningを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Actions Ci Tuningは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

GitHub Actions CI Tuning

Audit and improve GitHub Actions workflows. Focus on correctness first (jobs that error rather than fail), then speed (cache, parallelism), then reliability (flakiness, artifact guards).


Workflow

  1. Inventory — list all .github/workflows/*.yml files and their trigger events, jobs, and rough durations (gh run list --workflow <file> --limit 5).
  2. Audit against checklist — run through each section below and flag every gap.
  3. Prioritise — group findings by impact: correctness bugs > cache misses > parallelism gains > cosmetic.
  4. Propose changes — draft minimal diffs; do not refactor unrelated parts.
  5. Verify — after applying, confirm via gh run list that the next run is green and faster.

Checklist

Package Manager Cache

A cache miss means re-downloading hundreds of packages on every run. This is the single highest-ROI fix in most repos.

pnpm

yaml
- uses: pnpm/action-setup@v6
  with:
    version: latest           # or pin to a specific version

- uses: actions/setup-node@v7
  with:
    node-version-file: .nvmrc  # or node-version: '24' (current LTS)
    cache: 'pnpm'              # ← must be present; omitting it silently skips caching

Common mistake: calling corepack enable instead of pnpm/action-setup. corepack enable does NOT set up the pnpm store cache — actions/setup-node cache: 'pnpm' requires pnpm/action-setup to have run first.

npm

yaml
- uses: actions/setup-node@v7
  with:
    node-version-file: .nvmrc
    cache: 'npm'

yarn (classic / berry)

yaml
- uses: actions/setup-node@v7
  with:
    node-version-file: .nvmrc
    cache: 'yarn'

Verify cache is working: look for Cache restored successfully in setup-node logs. If absent, cache: key is likely missing or the lockfile path is wrong.


Dependency Install

  • Always use --frozen-lockfile (pnpm) / --ci (npm) / --immutable (yarn berry) in CI. Prevents lockfile drift from silently changing the installed tree.
  • Never use npm install or pnpm install without the frozen flag in CI.

Parallel Jobs vs. Steps

  • Independent jobs (lint, typecheck, test) should be separate jobs so they run in parallel, not sequential steps.
  • Sequential steps are fine for setup within a single job (install → build → test).
  • If a repo has lint + typecheck + unit test all in one job, split them.
yaml
jobs:
  lint:
    runs-on: ubuntu-latest
    steps: [checkout, setup, install, run lint]
  typecheck:
    runs-on: ubuntu-latest
    steps: [checkout, setup, install, run typecheck]
  test:
    runs-on: ubuntu-latest
    steps: [checkout, setup, install, run test]

Test Sharding (Playwright / Vitest)

Use sharding to cut long test suites. Each shard runs a subset of tests in parallel.

Playwright example — 4 shards:

yaml
jobs:
  e2e:
    strategy:
      fail-fast: false
      matrix:
        shard: [1, 2, 3, 4]
    steps:
      - run: pnpm exec playwright test --shard=${{ matrix.shard }}/4
        env:
          CI: true
      - uses: actions/upload-artifact@v7
        if: ${{ !cancelled() }}       # ← upload even on test failure
        with:
          name: blob-report-${{ matrix.shard }}
          path: blob-report/
          retention-days: 1

Pitfalls:

  • fail-fast: false is required — otherwise one failing shard cancels the rest before they upload blob reports.
  • if: ${{ !cancelled() }} on the upload step ensures blob reports are uploaded even when tests fail. Without this, the merge-reports job gets no artifacts.

Artifact Guard in merge-reports

When shards can fail before uploading blob reports, the all-blob-reports directory may not exist. Guard the merge command:

yaml
- name: Merge reports
  run: |
    if [ -d all-blob-reports ] && [ "$(ls -A all-blob-reports 2>/dev/null)" ]; then
      pnpm exec playwright merge-reports --reporter=html ./all-blob-reports
    else
      echo "No blob reports found, skipping merge"
      mkdir -p playwright-report
      echo "<html><body><p>No test results available</p></body></html>" > playwright-report/index.html
    fi

Without this guard, the merge-reports job errors with Error: Directory does not exist: ./all-blob-reports even when the overall workflow should gracefully report "no results."


Playwright Docker Image

For VRT (Visual Regression Testing), snapshots must be generated in the same environment as CI (Linux + specific fonts). Use the official Playwright Docker image instead of a plain node:* image:

mcr.microsoft.com/playwright:v1.59.1-noble   # pin to the same version as @playwright/test

Why not node:24?

  • node:24 requires playwright install --with-deps chromium which triggers apt-get and can hang for hours in Docker Desktop on macOS (known issue with apt in QEMU-emulated environments).
  • The mcr.microsoft.com/playwright image ships Chromium and all system dependencies pre-installed — no apt-get needed, starts in seconds.

Version pinning: keep the image version in sync with @playwright/test in package.json. Mismatch causes browser-not-found errors.


Concurrency Control

Cancel in-progress runs for the same branch/PR to avoid queue buildup:

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

Exception: do NOT cancel release/deploy workflows on main. Scope it to PR branches only:

yaml
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

Scheduled Workflow Reliability

  • Scheduled workflows on GitHub Actions can silently stop firing if the repo has no activity for 60 days.
  • Add a workflow_dispatch: trigger alongside schedule: so it can be manually re-triggered without a code change.
  • For critical scheduled jobs (e.g., nightly E2E), add a failure notification step (GitHub issue creation, Slack, etc.) so silent failures are visible.
yaml
on:
  schedule:
    - cron: '0 0 * * *'
  workflow_dispatch:      # ← always add this

Action Version Pinning

  • Pin third-party actions to a full commit SHA, not a tag. Tags can be moved.
  • Use a comment with the human-readable version for readability:
yaml
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  • Dependabot or Renovate can keep SHA pins up to date automatically. Check that .github/dependabot.yml includes the github-actions ecosystem.

Node.js 20 deprecation warning: GitHub started issuing "Node.js 20 actions are deprecated" warnings in 2025/2026. This refers to the action's own runtime (runs.using: node20), not the project's Node version. Fix by upgrading to the first major version that uses node24:

actionfirst node24 majorcurrent major (2026-09)
actions/checkoutv6.0.0v7
actions/setup-nodev6.0.0v7
actions/cachev5.0.0v6
actions/upload-artifactv7.0.0v7
actions/download-artifactv8.0.0v8
aws-actions/configure-aws-credentialsv6.0.0v6

Latest pinned SHAs (verified 2026-09):

yaml
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: aws-actions/configure-aws-credentials@cbe3b392738ccf3f987d68400dafcf4b0624a56c # v6.2.4

Note: SHAs drift — always verify with gh release view --repo <owner>/<action> before pinning.


Environment Variables

  • CI: true should be set at the job or workflow level, not only in individual run steps. Many tools (Playwright, Vite, etc.) change behavior based on this flag.
  • Secrets should use ${{ secrets.NAME }} — never hardcode tokens.
  • NODE_OPTIONS: --max-old-space-size=4096 is sometimes needed for large builds in constrained runners (default heap is ~1.5 GB for a 7 GB runner).

Quick Audit Commands

bash
# List recent run durations for a workflow
gh run list --workflow e2e.yml --limit 10 --json databaseId,displayTitle,createdAt,updatedAt,conclusion \
  | jq '.[] | {title: .displayTitle, duration: (.updatedAt | fromdate) - (.createdAt | fromdate), conclusion: .conclusion}'

# Find jobs that always time out
gh run list --workflow e2e.yml --status failure --limit 20 --json databaseId \
  | jq -r '.[].databaseId' \
  | xargs -I{} gh run view {} --json jobs \
  | jq '.jobs[] | select(.conclusion == "timed_out") | .name'

# Check cache usage in a run
gh run view <run_id> --log | grep -i "cache"

Common Anti-Patterns

Anti-patternProblemFix
corepack enable only (no pnpm/action-setup)pnpm store is not cachedAdd pnpm/action-setup@v6 before setup-node
pnpm install without --frozen-lockfileLockfile can silently driftUse --frozen-lockfile always in CI
fail-fast: true on test matrixShards cancel before uploading artifactsSet fail-fast: false
Upload artifact without if: ${{ !cancelled() }}Blob reports lost on test failureAdd the if condition
playwright merge-reports without directory guardJob errors when no shards uploadedGuard with [ -d all-blob-reports ] check
node:* image for Playwright VRTapt-get hangs in Docker Desktop on macOSUse mcr.microsoft.com/playwright image
Scheduled workflow without workflow_dispatchCan't manually re-triggerAlways add workflow_dispatch:
Action pinned to tag not SHATag can be moved (supply-chain risk)Pin to full commit SHA

よくある質問

AIスキル「Actions Ci Tuning」では何ができますか?

プロジェクトのGitHub Actionsワークフローを監査または改善するときに使用します。キャッシュの設定(npm/pnpm/yarn)、ジョブの並列化、シャード単位のテスト分割、アーティファクト処理の落とし穴、Playwright固有のパターンを扱います。CIの遅延、キャッシュミス、不安定なシャードジョブ、merge-reportsの失敗、「tune CI」という明示的な依頼に反応して起動します。

TypingMindでActions Ci Tuningを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Actions Ci Tuningはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにActions Ci Tuningをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/mizchi/skills/tree/main/actions-ci-tuningを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Actions Ci Tuningを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Actions Ci Tuningで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもActions Ci Tuningを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Actions Ci Tuning」は無料ですか?

mizchiがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇