Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
19 changes: 0 additions & 19 deletions .github/problemMatchers/oxfmt.json

This file was deleted.

20 changes: 0 additions & 20 deletions .github/problemMatchers/oxlint.json

This file was deleted.

137 changes: 83 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,149 +1,178 @@
name: ci

on:
pull_request:
branches:
- main
- release
push:
branches:
- main
pull_request:
merge_group:
branches:
- main

permissions: {}
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
cancel-in-progress: true

jobs:
Linting:
name: Lint & Format
runs-on: ubuntu-latest
lint:
name: πŸ”  Lint project
runs-on: ubuntu-24.04-arm
timeout-minutes: 15
permissions:
contents: read

steps:
- name: Checkout Project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Add problem matchers
run: |
echo "::add-matcher::.github/problemMatchers/oxlint.json"
echo "::add-matcher::.github/problemMatchers/oxfmt.json"

- name: Setup pnpm + Node.js v24
uses: pnpm/setup@5d160c5bc68a09337ad0d5654e237e03253b5879 # v1
with:
runtime: node@24
cache: true
install: false

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Run lint
run: pnpm lint

Building:
name: Build & Typecheck
runs-on: ubuntu-latest
build:
name: πŸ—οΈ Build & Typecheck
runs-on: ubuntu-24.04-arm
timeout-minutes: 15
permissions:
contents: read
actions: write

steps:
- name: Checkout Project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- name: Add problem matchers
run: echo "::add-matcher::.github/problemMatchers/tsc.json"

- name: Setup pnpm + Node.js v24
uses: pnpm/setup@5d160c5bc68a09337ad0d5654e237e03253b5879 # v1
with:
runtime: node@24
cache: true
install: false

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build code
run: pnpm build

- name: Typecheck code
run: pnpm typecheck

UnitTesting:
name: Unit Tests
runs-on: ubuntu-latest
unit:
name: πŸ§ͺ Unit tests
runs-on: ubuntu-24.04-arm
timeout-minutes: 10
permissions:
contents: read
actions: write

steps:
- name: Checkout Project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- name: Setup pnpm + Node.js v24
uses: pnpm/setup@5d160c5bc68a09337ad0d5654e237e03253b5879 # v1
with:
runtime: node@24
cache: true
install: false

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Run unit tests
run: pnpm test
- name: Store code coverage report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
run: pnpm test --reporter=default --reporter=junit --outputFile=test-report.junit.xml

- name: Upload test results to Codecov
if: ${{ !cancelled() && github.repository_owner == 'wolfstar-project' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: coverage
path: coverage/
disable_search: true
files: test-report.junit.xml
flags: unit
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}

Changesets:
name: Verify changesets
runs-on: ubuntu-latest
- name: Upload coverage reports to Codecov
if: ${{ !cancelled() && github.repository_owner == 'wolfstar-project' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
disable_search: true
files: coverage/clover.xml
flags: unit
token: ${{ secrets.CODECOV_TOKEN }}

knip:
name: 🧹 Unused code check
runs-on: ubuntu-24.04-arm
timeout-minutes: 10
if: |
github.event_name == 'pull_request'
&& github.event.pull_request.title != 'Version Packages'
&& !startsWith(github.head_ref, 'changeset-release/')
permissions:
contents: read

steps:
- name: Checkout Project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false

- name: Setup pnpm + Node.js v24
uses: pnpm/setup@5d160c5bc68a09337ad0d5654e237e03253b5879 # v1
with:
runtime: node@24
cache: true
install: false

- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Verify changesets
env:
BASE_REF: ${{ github.base_ref }}
run: pnpm exec changeset status --since=origin/${BASE_REF}

Upload_Coverage_Report:
name: Upload coverage report to codecov
needs: UnitTesting
runs-on: ubuntu-latest
- name: Check for unused code
run: pnpm run knip

changesets:
name: πŸ¦‹ Verify changesets
runs-on: ubuntu-24.04-arm
timeout-minutes: 10
if: github.repository_owner == 'wolfstar-project'
permissions:
contents: read
if: |
github.event_name == 'pull_request'
&& github.event.pull_request.title != 'chore: update changelog and release'
&& !startsWith(github.head_ref, 'changeset-release/')
steps:
- name: Checkout Project
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 2
fetch-depth: 0
persist-credentials: false
- name: Download NodeJS Unit Test Coverage report
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: coverage
path: coverage/
- name: Codecov Upload
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0

- name: Setup pnpm + Node.js v24
uses: pnpm/setup@5d160c5bc68a09337ad0d5654e237e03253b5879 # v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
runtime: node@24
cache: true
install: false

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Verify changesets
env:
BASE_REF: ${{ github.base_ref }}
run: pnpm exec changeset status --since=origin/${BASE_REF}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ tsup.config.bundled*.mjs
# Ignore heapsnapshot and log files
*.heapsnapshot
*.log

# Test artifacts
coverage/
*.junit.xml
docs/

# Ignore package locks
Expand Down
35 changes: 35 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "https://unpkg.com/knip@latest/schema.json",
"rules": {
"exports": "off",
"types": "off",
"enumMembers": "off"
},
"workspaces": {
".": {
"entry": ["scripts/*.{mjs,ts}"],
"project": ["scripts/**/*.{mjs,ts}"],
"ignoreDependencies": ["@favware/npm-deprecate", "@swc/core", "@types/ws", "cz-conventional-changelog"]
},
"packages/*": {
"entry": ["src/index.ts", "src/register.ts", "tests/**/*.ts"],
"project": ["src/**/*.ts", "tests/**/*.ts"],
"ignoreDependencies": ["tslib"]
},
"packages/shared-http-pieces": {
"ignoreDependencies": ["@discordjs/collection", "tslib"]
},
"packages/shared-influx-pieces": {
"ignoreDependencies": ["@sapphire/pieces", "tslib"]
},
"packages/weather-helpers": {
"ignoreDependencies": ["@sapphire/utilities", "@types/he"]
},
"packages/create-http-framework": {
"ignoreDependencies": ["@types/handlebars", "@types/mri"]
},
"packages/http-framework": {
"ignoreDependencies": ["@wolfstar/http-framework-test-utils"]
}
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "oxlint packages && oxfmt --check packages",
"lint:fix": "oxlint --fix packages && oxfmt --write packages",
"test": "vitest run",
"knip": "knip",
"build": "turbo run build",
"typecheck": "turbo run typecheck",
"update": "pnpm update --interactive --recursive",
Expand All @@ -32,6 +33,7 @@
"@vitest/coverage-v8": "^4.1.9",
"cz-conventional-changelog": "^3.3.0",
"husky": "9.1.7",
"knip": "6.20.0",
"nano-staged": "1.0.2",
"oxfmt": "0.55.0",
"oxlint": "1.70.0",
Expand Down
Loading
Loading