Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Commit ff640c2

Browse files
takaokoujiclaude
andcommitted
feat: split CI/CD workflow into parallel jobs for faster execution
Split the single ci-cd job into two parallel jobs: - test: Lint + Unit Tests (runs on PR/feature branches only) - build-and-deploy: Build + Integration Tests + Deploy (always runs) Changes: - Added job-level `if` condition for test job - Renamed artifact names to avoid conflicts: - test-output-unit (from test job) - test-output-integration (from build-and-deploy job) Expected benefit: Reduced CI execution time through parallel execution. Fixes #519 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1cdd584 commit ff640c2

1 file changed

Lines changed: 40 additions & 16 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ permissions:
1616
pull-requests: write # comment on released pull requests
1717

1818
jobs:
19-
ci-cd:
19+
test:
2020
runs-on: ubuntu-latest
21+
if: |
22+
(!(
23+
github.ref == 'refs/heads/develop' ||
24+
github.ref == 'refs/heads/master' ||
25+
github.ref == 'refs/heads/main'
26+
))
2127
env:
22-
DETECT_CHROMEDRIVER_VERSION: "true"
2328
JEST_JUNIT_OUTPUT_DIR: test-results
2429
NODE_OPTIONS: --max-old-space-size=4000
2530
steps:
@@ -41,24 +46,43 @@ jobs:
4146
- name: Build scratch-vm for smalruby
4247
run: npm run setup-scratch-vm
4348
- name: Lint
44-
if: |
45-
(!(
46-
github.ref == 'refs/heads/develop' ||
47-
github.ref == 'refs/heads/master' ||
48-
github.ref == 'refs/heads/main'
49-
))
5049
run: npm run test:lint
5150
- name: Run Unit Tests
52-
if: |
53-
(!(
54-
github.ref == 'refs/heads/develop' ||
55-
github.ref == 'refs/heads/master' ||
56-
github.ref == 'refs/heads/main'
57-
))
5851
env:
5952
JEST_JUNIT_OUTPUT_NAME: unit-results.xml
6053
JEST_JUNIT_OUTPUT_DIR: test-results/unit
6154
run: npm run test:unit -- --reporters="default" --reporters="jest-junit" --coverage --coverageReporters=text --coverageReporters=lcov --maxWorkers="2"
55+
- name: Store Test Results
56+
if: always() # Even if tests fail
57+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
58+
with:
59+
name: test-output-unit
60+
path: ./test-results/*
61+
62+
build-and-deploy:
63+
runs-on: ubuntu-latest
64+
env:
65+
DETECT_CHROMEDRIVER_VERSION: "true"
66+
JEST_JUNIT_OUTPUT_DIR: test-results
67+
NODE_OPTIONS: --max-old-space-size=4000
68+
steps:
69+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
70+
- uses: actions/setup-node@26961cf329f22f6837d5f54c3efd76b480300ace # v4
71+
with:
72+
cache: "npm"
73+
node-version-file: ".nvmrc"
74+
- name: Info
75+
run: |
76+
cat <<EOF
77+
Node version: $(node --version)
78+
NPM version: $(npm --version)
79+
GitHub ref: ${{ github.ref }}
80+
GitHub head ref: ${{ github.head_ref }}
81+
EOF
82+
- name: Install Dependencies
83+
run: npm ci
84+
- name: Build scratch-vm for smalruby
85+
run: npm run setup-scratch-vm
6286
- name: Run Build
6387
env:
6488
NODE_OPTIONS: --max-old-space-size=4000
@@ -105,8 +129,8 @@ jobs:
105129
if: always() # Even if tests fail
106130
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
107131
with:
108-
name: test-output
109-
path: ./test-results/* # Both unit and integration test results
132+
name: test-output-integration
133+
path: ./test-results/*
110134
- run: |
111135
if [[ ${{ contains(github.ref, 'hotfix') }} == 'true' ]]; then
112136
sed -e "s|hotfix/REPLACE|${{ github.ref_name }}|" --in-place release.config.js

0 commit comments

Comments
 (0)