From 0120263df9619a425caaa1ff6416f2d62448252a Mon Sep 17 00:00:00 2001 From: Kouji Takao Date: Mon, 26 Jan 2026 07:54:02 +0900 Subject: [PATCH 1/5] feat: implement Phase 6 - CI/CD updates for monorepo migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Created root-level ci-cd.yml and commitlint.yml - Integrated scratch-gui and scratch-vm tests into a unified workflow - Set up deployment to smalruby.app for develop/main/master branches - Updated smalruby3-editor submodule reference to include new CI scripts Closes #40 🤖 Generated with [Gemini Code](https://gemini.google.com/code) Co-Authored-By: Gemini --- .github/workflows/ci-cd.yml | 113 +++++++++++++++++++++++++++++++ .github/workflows/commitlint.yml | 15 ++++ gui/smalruby3-editor | 2 +- 3 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-cd.yml create mode 100644 .github/workflows/commitlint.yml diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..6a462e4 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,113 @@ +name: CI/CD + +on: + pull_request: + push: + branches: [main, master, develop, hotfix/*] + workflow_dispatch: + +concurrency: + group: "${{ github.workflow }} @ ${{ github.head_ref || github.ref }}" + cancel-in-progress: true + +permissions: + contents: write + pages: write + +env: + NODE_OPTIONS: --max-old-space-size=4000 + DETECT_CHROMEDRIVER_VERSION: "true" + +jobs: + test: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + defaults: + run: + working-directory: gui/smalruby3-editor + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + cache: "npm" + cache-dependency-path: gui/smalruby3-editor/package-lock.json + node-version-file: "gui/smalruby3-editor/.nvmrc" + - name: Install Dependencies + run: npm ci + - name: Create Test Results Directory + run: | + mkdir -p packages/scratch-gui/test-results + mkdir -p packages/scratch-vm/test-results + - name: Lint + run: npm run lint + - name: Unit tests + run: | + npm run test:unit:gui -- --reporters="default" --reporters="jest-junit" + npm run test:unit:vm -- -R junit > packages/scratch-vm/test-results/unit.xml + - name: Store Test Results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results-unit + path: | + gui/smalruby3-editor/packages/scratch-gui/test-results + gui/smalruby3-editor/packages/scratch-vm/test-results + + build-and-deploy: + runs-on: ubuntu-latest + defaults: + run: + working-directory: gui/smalruby3-editor + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + cache: "npm" + cache-dependency-path: gui/smalruby3-editor/package-lock.json + node-version-file: "gui/smalruby3-editor/.nvmrc" + - name: Install Dependencies + run: npm ci + - name: Build + env: + GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} + GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} + MESH_GRAPHQL_ENDPOINT: ${{ secrets.MESH_GRAPHQL_ENDPOINT }} + MESH_API_KEY: ${{ secrets.MESH_API_KEY }} + MESH_AWS_REGION: ${{ secrets.MESH_AWS_REGION }} + run: npm run build + - name: Create Test Results Directory + run: | + mkdir -p packages/scratch-gui/test-results + mkdir -p packages/scratch-vm/test-results + - name: Integration tests + if: github.event_name == 'pull_request' + run: | + npm run test:integration:gui -- --reporters="default" --reporters="jest-junit" + npm run test:integration:vm -- -R junit > packages/scratch-vm/test-results/integration.xml + - name: Store Test Results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results-integration + path: | + gui/smalruby3-editor/packages/scratch-gui/test-results + gui/smalruby3-editor/packages/scratch-vm/test-results + - name: Store Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: build-output + path: gui/smalruby3-editor/packages/scratch-gui/build + - name: Prepare deployment files + if: github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') + run: touch packages/scratch-gui/build/.nojekyll + - name: Deploy to smalruby.app + uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3 + if: | + github.event_name == 'push' && + (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') + with: + deploy_key: ${{ secrets.SMALRUBY_APP_DEPLOY_KEY }} + publish_dir: gui/smalruby3-editor/packages/scratch-gui/build + full_commit_message: "Build for ${{ github.sha }} ${{ github.event.head_commit.message }}" + cname: smalruby.app + external_repository: smalruby/smalruby.app diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000..866b048 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,15 @@ +name: Lint commit messages +on: [pull_request] + +concurrency: + group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.sha }}" + cancel-in-progress: true + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: wagoid/commitlint-github-action@v5 diff --git a/gui/smalruby3-editor b/gui/smalruby3-editor index dd431ec..6e9c14c 160000 --- a/gui/smalruby3-editor +++ b/gui/smalruby3-editor @@ -1 +1 @@ -Subproject commit dd431ec8fa6a033409309be8f525cce0d45b8b88 +Subproject commit 6e9c14cd4a5337b05b23091085c10ff6938c40ba From cdd16a7447497859f6eabd8ce525e5f1d605fbc9 Mon Sep 17 00:00:00 2001 From: Kouji Takao Date: Mon, 26 Jan 2026 08:41:36 +0900 Subject: [PATCH 2/5] docs: add rule for gh command message escaping to GEMINI.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Gemini Code](https://gemini.google.com/code) Co-Authored-By: Gemini --- GEMINI.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GEMINI.md b/GEMINI.md index 80b92c4..39b9817 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -191,6 +191,8 @@ Note: The smalruby3-gui package.json contains merge conflict markers from upstre **IMPORTANT**: All GitHub operations (issues, pull requests, comments, etc.) must be performed against the Smalruby organization repositories, NOT the upstream Scratch Foundation repositories. Always use the `gh` command for GitHub access. +**IMPORTANT: Message Escaping Rule**: When using the `gh` command to create issues or pull requests, always store the commit message or PR description in a temporary file first, and then use the `-F` (or `--body-file`) and `-F` (or `--title-file`) flags. Do not pass long or complex messages directly as command-line arguments to avoid shell escaping issues. + ### Correct Repository URLs - **scratch-vm**: https://github.com/smalruby/scratch-vm - **smalruby3-gui**: https://github.com/smalruby/smalruby3-gui From 761dd263facdb8580e243fde916681bda89c6566 Mon Sep 17 00:00:00 2001 From: Kouji Takao Date: Mon, 26 Jan 2026 22:42:35 +0900 Subject: [PATCH 3/5] feat: update smalruby3-editor submodule to include package-specific test result filenames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Gemini Code](https://gemini.google.com/code) Co-Authored-By: Gemini --- gui/smalruby3-editor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/smalruby3-editor b/gui/smalruby3-editor index 6e9c14c..95052ab 160000 --- a/gui/smalruby3-editor +++ b/gui/smalruby3-editor @@ -1 +1 @@ -Subproject commit 6e9c14cd4a5337b05b23091085c10ff6938c40ba +Subproject commit 95052abce08f5f4f2b45bfff6b8ea7a2050c5255 From 396484e1b09cdce1bdeafc61f142a2525e05c93c Mon Sep 17 00:00:00 2001 From: Kouji Takao Date: Mon, 26 Jan 2026 22:57:36 +0900 Subject: [PATCH 4/5] feat: update smalruby3-editor submodule to use generic test result filenames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Gemini Code](https://gemini.google.com/code) Co-Authored-By: Gemini --- gui/smalruby3-editor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/smalruby3-editor b/gui/smalruby3-editor index 95052ab..a792716 160000 --- a/gui/smalruby3-editor +++ b/gui/smalruby3-editor @@ -1 +1 @@ -Subproject commit 95052abce08f5f4f2b45bfff6b8ea7a2050c5255 +Subproject commit a79271677672f9bc3a1102d810b59e2367e7ec12 From 2789ce9d9809840db535d675a54a3ba60e53f5ee Mon Sep 17 00:00:00 2001 From: Kouji Takao Date: Mon, 26 Jan 2026 23:00:45 +0900 Subject: [PATCH 5/5] feat: update smalruby3-editor submodule (remove redundant VITEST_JUNIT_OUTPUT_FILE) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Gemini Code](https://gemini.google.com/code) Co-Authored-By: Gemini --- gui/smalruby3-editor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/smalruby3-editor b/gui/smalruby3-editor index a792716..b7c98f8 160000 --- a/gui/smalruby3-editor +++ b/gui/smalruby3-editor @@ -1 +1 @@ -Subproject commit a79271677672f9bc3a1102d810b59e2367e7ec12 +Subproject commit b7c98f8ffdcaf65bcf5ae35d58e5f0f08dfaced9