mirror of
https://github.com/yamadashy/repomix.git
synced 2026-02-03 11:33:39 +01:00
266 lines
8.8 KiB
YAML
266 lines
8.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
lint-biome:
|
|
name: Lint Biome
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- name: Install website server dependencies
|
|
working-directory: website/server
|
|
run: npm ci
|
|
- name: Lint website server
|
|
working-directory: website/server
|
|
run: npm run lint
|
|
|
|
lint-browser:
|
|
name: Lint Browser Extension
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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-action:
|
|
name: Lint GitHub Actions
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- uses: rhysd/actionlint@a443f344ff32813837fa49f7aa6cbc478d770e62 # v1.7.9
|
|
with:
|
|
args: "-color"
|
|
|
|
check-typos:
|
|
name: Check typos
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- uses: crate-ci/typos@2d0ce569feab1f8752f1dde43cc2f2aa53236e06 # v1.40.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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- name: Setup Bun ${{ matrix.bun-version }}
|
|
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
|
|
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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
with:
|
|
name: test-coverage
|
|
path: coverage/
|
|
- uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
|
|
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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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: Install only production dependencies
|
|
run: npm ci --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@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- name: Setup Bun ${{ matrix.bun-version }}
|
|
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
|
|
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@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
with:
|
|
name: repomix-output-bun-${{ matrix.os }}-${{ matrix.bun-version }}.txt
|
|
path: repomix-output.txt
|
|
|