Skip to content

Commit

Permalink
reveer test action and add sonarqube step to staging pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 authored and peggimann committed Nov 27, 2024
1 parent 39d4e22 commit 03b2acf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 32 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/staging-deploy-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,28 @@ jobs:
--form "projectVersion=latest" \
--form "[email protected]"
update-sonarqube:
needs: [generate-and-push-sbom]
sonarqube:
runs-on: ubuntu-latest

needs: [upload-to-quay]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21

- name: Set up JDK ${{ vars.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'oracle'
java-version: ${{ vars.JAVA_VERSION }}
distribution: 'temurin'

- name: Set up node ${{ vars.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}

- name: Install frontend dependencies
run: cd frontend && npm ci

- name: Generate frontend test coverage
run: cd frontend && npm run test -- --coverage

- name: Build and analyze
run: mvn clean verify sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }}
run: mvn clean verify sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dsonar.host.url=${{vars.SONAR_HOST_URL}}
38 changes: 13 additions & 25 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@
name: 'Show Variables'

on:
push:
workflow_dispatch:

jobs:
sonarqube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK ${{ vars.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ vars.JAVA_VERSION }}
distribution: 'temurin'

- name: Set up node ${{ vars.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}

- name: Install frontend dependencies
run: cd frontend && npm ci

- name: Generate frontend test coverage
run: cd frontend && npm run test -- --coverage

- name: Build and analyze
run: mvn clean verify sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dsonar.host.url=${{vars.SONAR_HOST_URL}}
display-variables:
name: Show GitHub Variables
steps:
- name: Try to show GitHub Variables
run: |
echo "repository variable : ${{ vars.REPOSITORY_VAR }}"
echo "organization variable : ${{ vars.ORGANIZATION_VAR }}"
echo "overridden variable : ${{ vars.OVERRIDE_VAR }}"
echo "variable from shell environment : $env_var"
echo "IMAGE_TAG : $vars.ENV_CONTEXT_VAR"
echo "IMAGE_TAG : $IMAGE_TAG"
echo "QUAY_URL : $QUAY_URL"

0 comments on commit 03b2acf

Please sign in to comment.