Skip to content

Commit

Permalink
test workflow separated
Browse files Browse the repository at this point in the history
  • Loading branch information
NEKOYASAN committed Mar 28, 2024
1 parent b4eb6a9 commit 61909ef
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/test-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test

on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version-file: .tool-versions

- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run tests and collect coverage
run: pnpm run vitest --coverage --changed

- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Kartore/web
5 changes: 3 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Test

on:
pull_request:
push:
branches:
- master

jobs:
test:
Expand Down Expand Up @@ -40,7 +41,7 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Run tests and collect coverage
run: pnpm run vitest --coverage --changed
run: pnpm run vitest --coverage

- name: Upload coverage to Codecov
uses: codecov/[email protected]
Expand Down

0 comments on commit 61909ef

Please sign in to comment.