mirror of
https://github.com/yamadashy/repomix.git
synced 2026-10-22 05:15:16 +02:00
prepack does not reliably run when installing repomix as a git dependency, causing the server Docker build to fail (lib/ directory missing). Change to prepare which reliably runs for git dependency installation. Also change npm ci --omit=dev to npm prune --omit=dev in Dockerfile and CI, since npm prune does not trigger lifecycle scripts (avoiding prepare failure when devDependencies are no longer available). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
347 lines
11 KiB
YAML
347 lines
11 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint-biome:
|
|
name: Lint Biome
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run lint-biome && git diff --exit-code
|
|
|
|
lint-oxlint:
|
|
name: Lint oxlint
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run lint-oxlint && git diff --exit-code
|
|
lint-ts:
|
|
name: Lint TypeScript
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run lint-ts
|
|
|
|
lint-secretlint:
|
|
name: Lint Secretlint
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run lint-secretlint
|
|
|
|
lint-website-client:
|
|
name: Lint Website Client
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- name: Install website client dependencies
|
|
working-directory: website/client
|
|
run: npm ci
|
|
- name: Lint website client
|
|
working-directory: website/client
|
|
run: npm run lint
|
|
|
|
lint-website-server:
|
|
name: Lint Website Server
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- name: Build and link local repomix
|
|
run: |
|
|
npm ci
|
|
npm run build
|
|
npm link
|
|
- name: Install website server dependencies
|
|
working-directory: website/server
|
|
run: |
|
|
npm ci
|
|
npm link repomix
|
|
- name: Lint website server
|
|
working-directory: website/server
|
|
run: npm run lint
|
|
|
|
bundle-website-server:
|
|
name: Bundle Website Server
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- name: Build and link local repomix
|
|
run: |
|
|
npm ci
|
|
npm run build
|
|
npm link
|
|
- name: Install website server dependencies
|
|
working-directory: website/server
|
|
run: |
|
|
npm ci
|
|
npm link repomix
|
|
- name: Bundle website server
|
|
working-directory: website/server
|
|
run: npm run bundle
|
|
|
|
lint-browser:
|
|
name: Lint Browser Extension
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- name: Install browser extension dependencies
|
|
working-directory: browser
|
|
run: npm ci
|
|
- name: Prepare WXT
|
|
working-directory: browser
|
|
run: npm run prepare
|
|
- name: Lint browser extension
|
|
working-directory: browser
|
|
run: npm run lint
|
|
|
|
lint-actionlint:
|
|
name: Lint GitHub Actions (actionlint)
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: rhysd/actionlint@393031adb9afb225ee52ae2ccd7a5af5525e03e8 # v1.7.11
|
|
with:
|
|
args: "-color"
|
|
|
|
lint-zizmor:
|
|
name: Lint GitHub Actions (zizmor)
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2
|
|
with:
|
|
advanced-security: "false"
|
|
annotations: "true"
|
|
config: .github/zizmor.yml
|
|
|
|
check-typos:
|
|
name: Check typos
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: crate-ci/typos@631208b7aac2daa8b707f55e7331f9112b0e062d # v1.44.0
|
|
|
|
test:
|
|
name: Test
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
node-version: [20.x, 22.x, 24.x, 25.x]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: npm ci
|
|
# Run tests directly instead of using npm scripts with node --run which is not supported in older Node versions
|
|
- run: ./node_modules/.bin/vitest --reporter=verbose
|
|
env:
|
|
CI_OS: ${{ runner.os }}
|
|
|
|
test-bun:
|
|
name: Test with Bun
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
bun-version: [latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup Bun ${{ matrix.bun-version }}
|
|
uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2.1.3
|
|
with:
|
|
bun-version: ${{ matrix.bun-version }}
|
|
- run: bun install
|
|
- run: bun run test
|
|
env:
|
|
CI_OS: ${{ runner.os }}
|
|
|
|
test-coverage:
|
|
name: Test coverage
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run test-coverage -- --reporter=verbose
|
|
env:
|
|
CI_OS: ${{ runner.os }}
|
|
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
|
with:
|
|
name: test-coverage
|
|
path: coverage/
|
|
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
|
|
with:
|
|
fail_ci_if_error: true
|
|
directory: ./coverage
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
test-browser:
|
|
name: Test Browser Extension
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- name: Install browser extension dependencies
|
|
working-directory: browser
|
|
run: npm ci
|
|
- name: Prepare WXT
|
|
working-directory: browser
|
|
run: npm run prepare
|
|
- name: Test browser extension
|
|
working-directory: browser
|
|
run: npm run test
|
|
|
|
build-and-run:
|
|
name: Build and run
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
node-version: [20.x, 22.x, 24.x, 25.x]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: npm ci
|
|
# Run build directly instead of using npm scripts with node --run which is not supported in older Node versions
|
|
- run: ./node_modules/.bin/rimraf lib && ./node_modules/.bin/tsc -p tsconfig.build.json --sourceMap --declaration
|
|
- name: Remove dev dependencies
|
|
run: npm prune --omit=dev
|
|
- run: node bin/repomix.cjs
|
|
- run: node bin/repomix.cjs --version
|
|
- run: node bin/repomix.cjs --help
|
|
- name: Upload build artifact
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
|
with:
|
|
name: repomix-output-${{ matrix.os }}-${{ matrix.node-version }}.txt
|
|
path: repomix-output.txt
|
|
|
|
build-and-run-bun:
|
|
name: Build and run with Bun
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
bun-version: [latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup Bun ${{ matrix.bun-version }}
|
|
uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2.1.3
|
|
with:
|
|
bun-version: ${{ matrix.bun-version }}
|
|
- run: bun install
|
|
- run: bun run build
|
|
- name: Install only production dependencies
|
|
run: bun install --production
|
|
- run: bun bin/repomix.cjs
|
|
- run: bun bin/repomix.cjs --version
|
|
- run: bun bin/repomix.cjs --help
|
|
- name: Upload build artifact
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
|
with:
|
|
name: repomix-output-bun-${{ matrix.os }}-${{ matrix.bun-version }}.txt
|
|
path: repomix-output.txt
|
|
|