Skip to content

Alpha > Master

Alpha > Master #12

name: Quality Control
on:
pull_request:
branches: [ master, beta, alpha ]
workflow_call:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm i -g pnpm@9
pnpm i --frozen-lockfile
- name: Run Unit Test
run: pnpm test
- name: Upload Test Coverage
uses: actions/upload-artifact@v4
with:
name: test-coverage
path: |
coverage
test-report.xml
build:
name: Build Dry Run
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm i -g pnpm@9
pnpm i --frozen-lockfile
- name: Run Build Dry Run
run: pnpm build
lint:
name: Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm i -g pnpm@9
pnpm i --frozen-lockfile
- name: Run Lint Check
run: pnpm lint
sonar:
name: SonarQube Scan
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download Test Coverage
uses: actions/download-artifact@v4
with:
name: test-coverage
- name: Run SonarQube Scan
uses: sonarsource/[email protected]
with:
args: >
-Dsonar.organization=${{ github.repository_owner }}
-Dsonar.projectKey=${{ github.event.repository.name }}
-Dsonar.pullrequest.key=${{ github.event.number }}
-Dsonar.pullrequest.branch=${{ github.HEAD_REF }}
-Dsonar.pullrequest.base=${{ github.BASE_REF }}
-Dsonar.sources=source
-Dsonar.tests=source
-Dsonar.test.inclusions=source/**/*.spec.ts
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.testExecutionReportPaths=test-report.xml
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io
- name: Run SonarQube Quality Gate
if: github.event.repository.name != 'master' && github.event.repository.name != 'beta' && github.event.repository.name != 'alpha'
uses: sonarsource/[email protected]
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}