chore(deps): upgrade dependencies #94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: code scans | |
on: | |
pull_request: {} | |
workflow_dispatch: {} | |
merge_group: {} | |
jobs: | |
sonarqube: | |
name: sonarqube scan | |
runs-on: 'ubuntu-latest' | |
services: | |
sonarqube: | |
image: public.ecr.aws/docker/library/sonarqube:10-community | |
ports: | |
- 9000:9000 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Install dependencies | |
run: yarn install --check-files && yarn --cwd example/ install --check-files | |
- name: Run build and unit tests | |
run: npx projen compile && npx projen test | |
- name: Configure sonarqube | |
env: | |
SONARQUBE_URL: http://localhost:9000 | |
SONARQUBE_ADMIN_PASSWORD: ${{ secrets.SONARQUBE_ADMIN_PASSWORD }} | |
run: | | |
bash .github/workflows/sonarqube/sonar-configure.sh | |
- name: SonarQube Scan | |
uses: sonarsource/sonarqube-scan-action@master | |
env: | |
SONAR_HOST_URL: http://sonarqube:9000 | |
SONAR_TOKEN: ${{ env.SONARQUBE_TOKEN }} | |
with: | |
args: > | |
-Dsonar.projectKey=pr-${{ github.event.pull_request.number }} | |
# Check the Quality Gate status. | |
- name: SonarQube Quality Gate check | |
id: sonarqube-quality-gate-check | |
uses: sonarsource/sonarqube-quality-gate-action@master | |
# Force to fail step after specific time. | |
timeout-minutes: 5 | |
env: | |
SONAR_TOKEN: ${{ env.SONARQUBE_TOKEN }} | |
SONAR_HOST_URL: http://localhost:9000 | |
- uses: phwt/sonarqube-quality-gate-action@v1 | |
id: quality-gate-check | |
if: always() | |
with: | |
sonar-project-key: pr-${{ github.event.pull_request.number }} | |
sonar-host-url: http://sonarqube:9000 | |
sonar-token: ${{ env.SONARQUBE_TOKEN }} | |
github-token: ${{ secrets.PROJEN_GITHUB_TOKEN }} | |
- name: Set up Sonar Quality Gate | |
uses: zxkane/sonar-quality-gate@master | |
if: always() | |
env: | |
DEBUG: true | |
GITHUB_TOKEN: ${{ secrets.PROJEN_GITHUB_TOKEN }} | |
GIT_URL: "https://api.github.com" | |
GIT_TOKEN: ${{ secrets.PROJEN_GITHUB_TOKEN }} | |
SONAR_URL: http://sonarqube:9000 | |
SONAR_TOKEN: ${{ env.SONARQUBE_TOKEN }} | |
SONAR_PROJECT_KEY: pr-${{ github.event.pull_request.number }} | |
with: | |
login: ${{ env.SONARQUBE_TOKEN }} | |
skipScanner: true |