Skip to content

Commit d9a9ba0

Browse files
committed
Add new GitHub Actions pipeline for frontend CI
1 parent 473ccc2 commit d9a9ba0

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

.github/workflows/frontend-ci.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: frontend-ci
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Extract versions from pom.xml
15+
id: extract_versions
16+
run: |
17+
NODE_VERSION=$(xmllint --xpath 'string(//properties/node.version)' pom.xml)
18+
NPM_VERSION=$(xmllint --xpath 'string(//properties/npm.version)' pom.xml)
19+
echo "NODE_VERSION=$NODE_VERSION" >> "$GITHUB_ENV"
20+
echo "NPM_VERSION=$NPM_VERSION" >> "$GITHUB_ENV"
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: '${{ env.NODE_VERSION }}'
24+
cache: 'npm'
25+
- run: npm install --global 'npm@${{ env.NPM_VERSION }}'
26+
- run: npm ci
27+
- run: npm run lint
28+
- run: npm run build
29+
- run: npm test

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pipeline-graph-view-plugin",
3-
"version": "1.0.0",
3+
"version": "0.0.0-development",
44
"description": "Pipeline Graph visualization for Jenkins pipelines",
55
"private": true,
66
"type": "module",
@@ -11,7 +11,7 @@
1111
"build:dev": "vite build --mode development --watch",
1212
"lint": "tsc && eslint && prettier --check .",
1313
"lint:fix": "eslint --fix && prettier --write .",
14-
"test": "vitest --watch=false --reporter default --reporter junit && npm run lint",
14+
"test": "vitest --watch=false",
1515
"test:dev": "vitest --watch"
1616
},
1717
"repository": {

vitest.config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import { defineConfig } from "vitest/config";
2-
import path from "node:path";
32

43
export default defineConfig({
54
test: {
65
root: "src/main/frontend",
76
globals: true,
87
environment: "jsdom",
98
setupFiles: ["setupTests.ts"],
10-
outputFile: path.resolve(
11-
import.meta.dirname,
12-
"target/surefire-reports/vitest-junit.xml",
13-
),
149
},
1510
});

0 commit comments

Comments
 (0)