Commit 8cb9c682 authored by Carsten Heidmann's avatar Carsten Heidmann
Browse files

move SonarQube jobs to test stage

add wait for qualitygate=true
parent 01465f4b
name: Build & Sonarqube
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
- run: npm run test:sonarqube
env:
SONAR_AUTH_TOKEN: ${{secrets.SONAR_AUTH_TOKEN}}
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install
- run: npm test
env:
SONAR_AUTH_TOKEN: ${{secrets.SONAR_AUTH_TOKEN}}
stages:
- build
- test
- package
- deploy
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- ".m2/repository"
include:
- local: .gitlab/ci/ci.yml
# - local: .gitlab/ci/build-and-sonarqube-ci.yml
sonarqube_node12:
only:
- master
stage: test
image: node:12-buster-slim
before_script:
- apt-get update -yqq
- apt-get install -y gnupg2 wget apt-transport-https
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
- apt-get update -yqq
- apt-get install -y google-chrome-stable
script:
- npm ci
- npm run build --if-present
- npm test
- npm run test:sonarqube
sonarqube_node14:
only:
- master
stage: test
image: node:14-buster-slim
before_script:
- apt-get update -yqq
- apt-get install -y gnupg2 wget apt-transport-https
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
- apt-get update -yqq
- apt-get install -y google-chrome-stable
script:
- npm ci
- npm run build --if-present
- npm test
- npm run test:sonarqube
ci_build_node12:
only:
- master
- merge_requests
stage: build
image: node:12-buster-slim
before_script:
- apt-get update -yqq
- apt-get install -y gnupg2 wget apt-transport-https
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
- apt-get update -yqq
- apt-get install -y google-chrome-stable
script:
- npm install
- npm test
ci_build_node14:
only:
- master
- merge_requests
stage: build
image: node:14-buster-slim
before_script:
- apt-get update -yqq
- apt-get install -y gnupg2 wget apt-transport-https
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
- apt-get update -yqq
- apt-get install -y google-chrome-stable
script:
- npm install
- npm test
......@@ -15,6 +15,8 @@ sonarqubeScanner(
'sonar.test.inclusions': 'src/**/*.spec.js',
'sonar.coverage.exclusions':
'src/**/*.spec.js,src/**/*.mock.js,node_modules/*,coverage/lcov-report/*',
'sonar.qualitygate.wait': 'true',
'sonar.qualitygate.timeout': '30'
},
},
() => process.exit(),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment