forked from anti-work/shortest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
pipeline { | ||
agent { | ||
docker { | ||
image 'node:20' | ||
args '-u root' // Run as root to handle permissions | ||
} | ||
} | ||
|
||
stages { | ||
stage('Checkout') { | ||
steps { | ||
// First configure git to trust the workspace directory | ||
sh 'git config --global --add safe.directory "*"' | ||
|
||
// Then do the git checkout | ||
git branch: 'feat/tdd', | ||
url: 'https://github.com/m2rads/shortest-test' | ||
|
||
// Print current branch for verification | ||
sh 'git branch --show-current' | ||
} | ||
} | ||
|
||
stage('Setup PNPM') { | ||
steps { | ||
sh ''' | ||
npm install -g pnpm | ||
pnpm --version | ||
''' | ||
} | ||
} | ||
|
||
stage('Install Dependencies') { | ||
steps { | ||
sh 'pnpm install' | ||
} | ||
} | ||
|
||
stage('Install Coverage Tool') { | ||
steps { | ||
sh 'pnpm add -D @vitest/coverage-v8' | ||
} | ||
} | ||
|
||
stage('Run Tests') { | ||
steps { | ||
sh 'npx vitest run' | ||
} | ||
} | ||
} | ||
} |