Skip to content

Commit

Permalink
test : fix sonar config & adapt CI (#870)
Browse files Browse the repository at this point in the history
* ci: update test CI

* test: fix coverage config for sonar
  • Loading branch information
QRuhier authored Oct 22, 2024
1 parent 9ba24ab commit 4c3c4bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: ['main', '1.*']
pull_request:
branches: ['main', '1.*']
types: [opened, synchronize, reopened]

jobs:
build:
Expand Down
27 changes: 10 additions & 17 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,32 @@ name: Pogues Test CI

on:
push:
branches:
- '**'
tags:
- '*'
branches: ['main', '1.*']
pull_request:
types: [opened, synchronize, reopened]

jobs:
test-build:
name: Test & build
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: yarn
# Run tests & build sonar reports
# Run tests sonar reports
- run: yarn test:coverage
# Build lib
- run: yarn build
- name: Upload deploy artifact
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage/
- name: Upload deploy artifact
uses: actions/upload-artifact@v4
with:
name: build
path: dist/
path: coverage

sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
needs: test-build
needs: test
steps:
- uses: actions/checkout@v4
with:
Expand Down
4 changes: 1 addition & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export default defineConfig({
environment: 'jsdom',
setupFiles: ['./src/setupTests.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
reportsDirectory: 'coverage',
reporter: ['text', 'lcov'],
},
},
resolve: {
Expand Down

0 comments on commit 4c3c4bd

Please sign in to comment.