Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/proud-pants-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
93 changes: 73 additions & 20 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,59 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
name: Detect changed paths
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v4
Comment thread
cameri marked this conversation as resolved.
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dorny/paths-filter relies on git history for non-PR events (e.g., push), but actions/checkout here uses the default shallow clone. Configure actions/checkout with an appropriate fetch-depth (commonly 0 or at least 2) so the action can diff github.event.before..after reliably.

Suggested change
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0

Copilot uses AI. Check for mistakes.
- id: filter
uses: dorny/paths-filter@v3
with:
filters: |
src:
- 'src/**'
- 'test/**'
- 'package.json'
- 'package-lock.json'
- 'tsconfig*.json'
- 'biome.json'
- '.knip.json'
- 'Dockerfile*'
- 'docker-compose*.yml'
- '.nvmrc'
- '.github/workflows/checks.yml'

commit-lint:
name: Lint commits
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install package dependencies
run: npm ci
- name: Run commitlint
uses: wagoid/commitlint-github-action@v5

lint:
name: Lint code
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.src == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
Expand All @@ -44,31 +74,40 @@ jobs:
run: npm run lint
- name: Run Knip
run: npm run knip

build-check:
name: Build check
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.src == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install package dependencies
run: npm ci
- name: Run build check
run: npm run build:check

test-units-and-cover:
name: Unit Tests And Coverage
runs-on: ubuntu-latest
needs:
- commit-lint
- changes
- lint
- build-check
if: |
always() &&
needs.changes.outputs.src == 'true' &&
needs.lint.result != 'failure' &&
needs.build-check.result != 'failure'
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit test job condition allows execution when lint/build-check are cancelled (because it only blocks failure). If the intent is to only run tests after those jobs succeed, change the condition to require needs.lint.result == 'success' and needs.build-check.result == 'success'.

Suggested change
needs.lint.result != 'failure' &&
needs.build-check.result != 'failure'
needs.lint.result == 'success' &&
needs.build-check.result == 'success'

Copilot uses AI. Check for mistakes.
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
Expand All @@ -93,17 +132,23 @@ jobs:
flag-name: Unit
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true

test-integrations-and-cover:
name: Integration Tests and Coverage
runs-on: ubuntu-latest
needs:
- commit-lint
- changes
- lint
- build-check
if: |
always() &&
needs.changes.outputs.src == 'true' &&
needs.lint.result != 'failure' &&
needs.build-check.result != 'failure'
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the unit test job: the integration test job condition only blocks on failure, so tests may still run if lint/build-check were cancelled. If dependencies must pass, require needs.lint.result == 'success' and needs.build-check.result == 'success' instead.

Copilot uses AI. Check for mistakes.
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Run integration tests
Expand Down Expand Up @@ -131,27 +176,35 @@ jobs:
with:
name: integration-coverage-lcov
path: .coverage/integration/lcov.info

post-tests:
name: Post Tests
needs: [test-units-and-cover, test-integrations-and-cover]
runs-on: ubuntu-latest
needs:
- changes
- test-units-and-cover
- test-integrations-and-cover
if: ${{ always() }}
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
- name: Coveralls Finished
uses: coverallsapp/github-action@master
if: |
needs.test-units-and-cover.result != 'skipped' ||
needs.test-integrations-and-cover.result != 'skipped'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
Comment on lines +201 to +208
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coverallsapp/github-action@master is a floating ref, which is risky for supply-chain security and can introduce unexpected CI changes. Pin this to a stable release tag or (preferably) a commit SHA.

Copilot uses AI. Check for mistakes.

changeset-check:
name: Changeset Required
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.head_ref != 'changeset-release/main'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
Expand Down
87 changes: 87 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,15 @@
"relay",
"typescript"
],
"author": "Ricardo Arturo Cabral Mej\u00eda (npub1qqqqqqyz0la2jjl752yv8h7wgs3v098mh9nztd4nr6gynaef6uqqt0n47m)",
"author": "Ricardo Arturo Cabral Mejía (npub1qqqqqqyz0la2jjl752yv8h7wgs3v098mh9nztd4nr6gynaef6uqqt0n47m)",
"license": "MIT",
"bugs": {
"url": "https://github.com/cameri/nostream/issues"
},
"homepage": "https://github.com/cameri/nostream#readme",
"devDependencies": {
"@biomejs/biome": "^2.4.11",
"@changesets/changelog-github": "0.6.0",
"@changesets/cli": "^2.27.12",
"@commitlint/cli": "17.2.0",
"@commitlint/config-conventional": "17.2.0",
Expand Down
Loading