Skip to content
Merged
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
66 changes: 66 additions & 0 deletions .github/workflows/cli-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CLI Unit Test

on:
pull_request:
paths:
- 'apps/cli/**'
- '.github/workflows/cli-test.yml'
push:
branches: [main]
paths:
- 'apps/cli/**'
- '.github/workflows/cli-test.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30

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

- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24'

- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11.13.0
package_json_file: apps/cli/package.json

- name: Get pnpm store path
id: pnpm-cache
run: echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT
working-directory: apps/cli

- name: Cache pnpm store
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.pnpm-cache.outputs.store }}
key: pnpm-store-${{ runner.os }}-${{ hashFiles('apps/cli/pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-${{ runner.os }}-

- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: apps/cli

- name: Type-check contract tests
run: pnpm typecheck:test
working-directory: apps/cli

- name: Run tests
run: pnpm test
working-directory: apps/cli
49 changes: 26 additions & 23 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
{
"name": "@koyori/task-cli",
"version": "0.1.0",
"private": true,
"engines": {
"node": ">=20"
},
"bin": {
"task": "./bin/task.js"
},
"scripts": {
"build": "tsc",
"dev": "ts-node src/index.ts"
},
"dependencies": {
{
"name": "@koyori/task-cli",
"version": "0.1.0",
"private": true,
"engines": {
"node": ">=20"
},
"bin": {
"task": "./bin/task.js"
},
"scripts": {
"build": "tsc",
"dev": "ts-node src/index.ts",
"test": "pnpm run build && vitest run",
"typecheck:test": "tsc -p tsconfig.test.json"
},
"dependencies": {
"commander": "14.0.3",
"js-yaml": "4.3.0",
"openapi-fetch": "0.17.0"
},
"devDependencies": {
"@types/js-yaml": "4.0.9",
"@types/node": "24.13.3",
"ts-node": "10.9.2",
"typescript": "5.9.3"
}
}
},
"devDependencies": {
"@types/js-yaml": "4.0.9",
"@types/node": "24.13.3",
"ts-node": "10.9.2",
"typescript": "5.9.3",
"vitest": "4.1.10"
}
}
Loading