Files
2026-04-18 05:41:17 +00:00

215 lines
7.0 KiB
YAML

name: CI
on:
push:
branches: [main]
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '.github/releases/**'
- 'website/**'
- 'browser/**'
pull_request:
branches: [main]
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '.github/releases/**'
- 'website/**'
- 'browser/**'
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
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@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
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 --reporter=junit --outputFile.junit=./test-report.junit.xml
env:
CI_OS: ${{ runner.os }}
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: test-coverage
path: coverage/
- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
fail_ci_if_error: true
directory: ./coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1
if: ${{ !cancelled() }}
with:
files: ./test-report.junit.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
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@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
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