mirror of
https://github.com/yamadashy/repomix.git
synced 2026-10-28 10:15:24 +01:00
247 lines
9.0 KiB
YAML
247 lines
9.0 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@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run lint-biome && git diff --exit-code
|
|
|
|
lint-ts:
|
|
name: Lint TypeScript
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
|
|
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@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
|
|
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@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
|
|
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@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
|
|
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@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- name: Install browser extension dependencies
|
|
working-directory: browser
|
|
run: npm ci
|
|
- 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@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- uses: rhysd/actionlint@4e683ab8014a63fafa117492a0c6053758e6d593 # ratchet:rhysd/actionlint@v1.7.3
|
|
with:
|
|
args: "-color"
|
|
|
|
check-typos:
|
|
name: Check typos
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- uses: crate-ci/typos@d7e6241ebf2f59df88a9e53567d2fdc5141c2fd1 # ratchet:crate-ci/typos@master
|
|
|
|
test:
|
|
name: Test
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
node-version: [20.x, 21.x, 22.x, 23.x, 24.x]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
|
|
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@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- name: Setup Bun ${{ matrix.bun-version }}
|
|
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # ratchet:oven-sh/setup-bun@v2
|
|
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@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
|
|
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@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4
|
|
with:
|
|
name: test-coverage
|
|
path: coverage/
|
|
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # ratchet:codecov/codecov-action@v5
|
|
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@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
|
|
with:
|
|
node-version-file: .tool-versions
|
|
cache: npm
|
|
- name: Install browser extension dependencies
|
|
working-directory: browser
|
|
run: npm ci
|
|
- 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, 21.x, 22.x, 23.x, 24.x]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
|
|
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@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4
|
|
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@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
|
|
- name: Setup Bun ${{ matrix.bun-version }}
|
|
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # ratchet:oven-sh/setup-bun@v2
|
|
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@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4
|
|
with:
|
|
name: repomix-output-bun-${{ matrix.os }}-${{ matrix.bun-version }}.txt
|
|
path: repomix-output.txt
|