Added github actions to project
This commit is contained in:
parent
1e9d4e9104
commit
6e59bf067a
1 changed files with 68 additions and 0 deletions
68
.github/workflows/production-ci.yml
vendored
Normal file
68
.github/workflows/production-ci.yml
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
name: SonarCloud Analysis
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- production
|
||||
pull_request:
|
||||
branches:
|
||||
- production
|
||||
|
||||
jobs:
|
||||
do-scan:
|
||||
name: SonarCloud Scan
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "npm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run tests and generate coverage
|
||||
run: npm run coverage
|
||||
continue-on-error: true
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: SonarCloud Scan
|
||||
uses: SonarSource/sonarcloud-github-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
with:
|
||||
args: >
|
||||
-Dsonar.projectKey=xliviux_ydioy
|
||||
-Dsonar.organization=xliviux
|
||||
-Dsonar.projectName=YDIOY
|
||||
-Dsonar.projectVersion=1.0.0
|
||||
-Dsonar.sourceEncoding=UTF-8
|
||||
-Dsonar.sources=src, tests
|
||||
-Dsonar.inclusions=src/**/*.ts, src/**/*.js, src/**/*.vue, src/**/*.css, src/**/*.scss, tests/**/*.spec.ts
|
||||
-Dsonar.exclusions=**/node_modules/**, **/coverage/**, *.config.ts
|
||||
-Dsonar.coverage.exclusions=tests/**, *.config.ts
|
||||
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
|
||||
-Dsonar.testExecutionReportPaths=coverage/sonar-report.xml
|
||||
|
||||
- name: Check SonarCloud Quality Gate
|
||||
uses: sonarsource/sonarqube-quality-gate-action@master
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-results
|
||||
path: |
|
||||
coverage/
|
||||
Loading…
Add table
Add a link
Reference in a new issue