本プロジェクトでは GitHub Actions を使用した継続的インテグレーション (CI) とドキュメント生成を実装しています。
main ブランチへの変更時に、Linux/Windows 両環境での自動ビルド・テスト、およびドキュメント生成を実行し、コード品質を維持します。
本プロジェクトでは統合ワークフローを使用しています:
.github/workflows/ci.yml - ビルド、テスト、ドキュメント生成、Pages デプロイの統合ワークフローこのワークフローには以下の 4 つのジョブが含まれています:
build-and-test-linux - Linux 環境でのビルドとテスト (Oracle Linux 8 / Oracle Linux 10 のマトリクス実行)build-and-test-windows - Windows 環境でのビルドとテストpublish-docs - ドキュメント生成deploy-pages - テスト結果とドキュメントの統合と GitHub Pages へのデプロイLinux ビルド (OL8/OL10)、Windows ビルド、ドキュメント生成のジョブが並列実行されます。すべて完了後に deploy-pages ジョブがテスト結果とドキュメントを統合して GitHub Pages にデプロイします。
すべてのワークフローは以下のイベントで実行されます:
| イベント | 対象ブランチ |
|---|---|
| push | main |
| pull_request | main |
Linux 環境では Oracle Linux 開発コンテナをマトリクス戦略で使用し、複数バージョンでのビルドとテストを実行しています。
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os-name: ol8
image: ghcr.io/hondarer/oracle-linux-container/oracle-linux-8-dev:latest
- os-name: ol10
image: ghcr.io/hondarer/oracle-linux-container/oracle-linux-10-dev:latest
container:
image: ${{ matrix.image }}| OS 名 | コンテナイメージ | 説明 |
|---|---|---|
| ol8 | ghcr.io/hondarer/oracle-linux-container/oracle-linux-8-dev:latest |
Oracle Linux 8 開発コンテナ |
| ol10 | ghcr.io/hondarer/oracle-linux-container/oracle-linux-10-dev:latest |
Oracle Linux 10 開発コンテナ |
これらのコンテナには以下の開発ツールが含まれています:
| 変数名 | 値 | 説明 |
|---|---|---|
| HOST_USER | user | コンテナ内ユーザー名 |
| HOST_UID | 1001 | ユーザー ID |
| HOST_GID | 127 | グループ ID |
Windows 環境では Windows Server 2025 ランナーを使用しています。
runs-on: windows-2025Windows 環境では以下のツールを動的にセットアップしています:
Add-VSBT-Env-x64.ps1) で環境変数を設定make を実行してプロジェクトをビルドlogs/linux-build.log に保存make test を実行logs/linux-test.log に保存test/**/results/) を保存logs/) を保存Add-VSBT-Env-x64.ps1) で環境変数を設定make を実行してプロジェクトをビルドlogs/windows-build.log に保存make test を実行logs/windows-test.log に保存test/**/results/) を保存logs/) を保存このジョブは、build-and-test-linux および build-and-test-windows と並列に実行されます。
実行条件:
- 他のビルド&テストジョブと独立して並列実行されます
- CI 全体の実行時間を短縮し、効率的なリソース利用を実現します
処理フロー:
fetch-depth: 0 で全履歴を取得 (Markdown 処理時の author/date 取得用)git submodule update --init --recursive --depth 1 で浅いクローンmake doxy && make docs を実行このジョブは、上記のジョブ(build-and-test-linux (OL8/OL10)、build-and-test-windows、publish-docs)が並列実行され、すべて完了した後に実行されます。
実行条件:
- needs: [build-and-test-linux, build-and-test-windows, publish-docs] により、並列実行されたすべてのジョブが成功するまで待機
- if: github.ref == 'refs/heads/main' && github.event_name == 'push' により、main ブランチへの push 時のみ実行
処理フロー:
linux-ol8-test-results) をダウンロードlinux-ol10-test-results) をダウンロードwindows-test-results) をダウンロードdocumentation) をダウンロードlinux-ol8-logs) をダウンロードlinux-ol10-logs) をダウンロードwindows-logs) をダウンロードlinux-ol8-test-results.zip にアーカイブlinux-ol10-test-results.zip にアーカイブwindows-test-results.zip にアーカイブlinux-ol8-logs.zip にアーカイブlinux-ol10-logs.zip にアーカイブwindows-logs.zip にアーカイブdocs/artifacts/ に配置docs/ ディレクトリを gh-pages ブランチに公開アーティファクトストレージの役割:
GitHub Actions のアーティファクトストレージを中継ストレージとして使用することで、異なる OS 環境(Linux、Windows)で生成されたファイルを 1 つのジョブに集約します。
main ブランチへの push 時に、deploy-pages ジョブがドキュメントとテスト結果を統合して GitHub Pages に自動公開します。
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
force_orphan: true| パラメータ | 値 | 説明 |
|---|---|---|
| publish_dir | ./docs |
公開するディレクトリ |
| force_orphan | true |
履歴なしの孤立ブランチとしてデプロイ |
deploy-pages ジョブにより、以下の内容が Pages に統合配置されます:
https://<username>.github.io/<repository>/
+-- doxygen/ # Doxygen 生成 HTML
| +-- index.html
+-- artifacts/
| +-- docs-html-doxygen.zip # HTML ドキュメントアーカイブ doxygen (固定 URL)
| +-- docs-html-ja.zip # HTML ドキュメントアーカイブ ja (固定 URL)
| +-- docs-html-en.zip # HTML ドキュメントアーカイブ en (固定 URL)
| +-- docs-html-ja-details.zip # HTML ドキュメントアーカイブ ja-details (固定 URL)
| +-- docs-html-en-details.zip # HTML ドキュメントアーカイブ en-details (固定 URL)
| +-- docs-docx-ja.zip # DOCX ドキュメントアーカイブ ja (固定 URL)
| +-- docs-docx-en.zip # DOCX ドキュメントアーカイブ en (固定 URL)
| +-- docs-docx-ja-details.zip # DOCX ドキュメントアーカイブ ja-details (固定 URL)
| +-- docs-docx-en-details.zip # DOCX ドキュメントアーカイブ en-details (固定 URL)
| +-- linux-ol8-test-results.zip # Linux OL8 テスト結果アーカイブ (固定 URL)
| +-- linux-ol10-test-results.zip # Linux OL10 テスト結果アーカイブ (固定 URL)
| +-- windows-test-results.zip # Windows テスト結果アーカイブ (固定 URL)
| +-- linux-ol8-logs.zip # Linux OL8 ビルド&テストログ (固定 URL)
| +-- linux-ol10-logs.zip # Linux OL10 ビルド&テストログ (固定 URL)
| +-- windows-logs.zip # Windows ビルド&テストログ (固定 URL)
+-- (その他の生成ドキュメント)
固定 URL の利点:
- テスト結果アーカイブは常に同じファイル名で配置されるため、固定 URL でアクセス可能
- ドキュメントへのリンクをハードコードしても、更新後も同じ URL でアクセスできる
GitHub Pages を有効にするには、リポジトリ設定で以下を行います:
公開後、https://<username>.github.io/<repository>/ でアクセス可能になります。
CI 実行時に生成されるファイルをアーティファクトとして保存し、後から確認できます。
ジョブ間でファイルを受け渡すためのアーティファクトです。これらは deploy-pages ジョブで統合されます。
マトリクス戦略により、OL8/OL10 それぞれのアーティファクトが生成されます。
- name: Upload test results artifacts
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.os-name }}-test-results
path: test/**/results/
if-no-files-found: warn- name: Upload test results artifacts
uses: actions/upload-artifact@v4
with:
name: windows-test-results
path: test/**/results/
if-no-files-found: warn- name: Upload documentation artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/
if-no-files-found: warn含まれるファイル:
- docs/doxygen - Doxygen 生成 HTML
- docs/**/html - Pandoc 生成 HTML
- docs/artifacts/*.zip - ドキュメントアーカイブ
過去のビルドを参照するためのアーティファクトです。
言語ディレクトリごとに個別の artifact として保存されます (100MB 制限対策)。
- name: Upload html artifacts (doxygen)
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-docs-html-doxygen-${{ github.sha }}
path: docs/doxygen/
if-no-files-found: warn
- name: Upload html artifacts (ja)
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-docs-html-ja-${{ github.sha }}
path: docs/ja/html/
if-no-files-found: warn
- name: Upload html artifacts (en)
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-docs-html-en-${{ github.sha }}
path: docs/en/html/
if-no-files-found: warn
- name: Upload html artifacts (ja-details)
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-docs-html-ja-details-${{ github.sha }}
path: docs/ja-details/html/
if-no-files-found: warn
- name: Upload html artifacts (en-details)
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-docs-html-en-details-${{ github.sha }}
path: docs/en-details/html/
if-no-files-found: warn言語ディレクトリごとに個別の artifact として保存されます (100MB 制限対策)。
- name: Upload docx artifacts (ja)
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-docs-docx-ja-${{ github.sha }}
path: docs/ja/docx/
if-no-files-found: warn
- name: Upload docx artifacts (en)
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-docs-docx-en-${{ github.sha }}
path: docs/en/docx/
if-no-files-found: warn
- name: Upload docx artifacts (ja-details)
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-docs-docx-ja-details-${{ github.sha }}
path: docs/ja-details/docx/
if-no-files-found: warn
- name: Upload docx artifacts (en-details)
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-docs-docx-en-details-${{ github.sha }}
path: docs/en-details/docx/
if-no-files-found: warnPull Request 時はアーティファクトをダウンロードしてローカルでドキュメントやテスト結果を確認できます。
GitHub Container Registry (ghcr.io) からのイメージ取得には GITHUB_TOKEN を使用します。
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}CI と同等のビルドとテストをローカルで実行できます。
make
make test
make doxy
make docsmake
make test注意: Windows 環境では、事前に必要な環境設定を行う必要があります。詳細は CLAUDE.md の「Windows にてあらかじめ実施しなくてはいけない作業」を参照してください。