Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 31 additions & 24 deletions .github/workflows/irfan-quality-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,29 +54,36 @@ on:
type: string

jobs:
irfan:
runs-on: ubuntu-latest-4-cores
permissions:
id-token: write
contents: read
disabled-notice:
name: 'Steps disabled'
runs-on: ubuntu-latest
steps:
#TODO: Test adding Irfan's quality reporting stage inline here after sonar run (https://github.com/Progress-I360/github-action-reporting)
# PRODUCT_NAME = [Chef360 | Courier | Inspec]
- name: Run SonarQube report generation
if: ${{ inputs.report-to-atlassian-dashboard == true && inputs.visibility == 'internal' }}
uses: Progress-I360/github-action-reporting/sonarqube@main
with:
PRODUCT_NAME: ${{ inputs.quality-product-name }}
SONAR_APP_NAME: ${{ inputs.quality-sonar-app-name }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Echo disabled notice
run: echo "All other steps in this workflow have been disabled."
Comment on lines 60 to +62

# TESTING_TYPE = [Unit | Integration | e2e | api | Performance | Security]
# ENVIRONMENT = [DEV | STAGE | PROD] (optional)
- name: Run report generation
if: ${{ inputs.report-to-atlassian-dashboard == true && inputs.report-unit-test-coverage == true && inputs.visibility == 'internal' }}
uses: Progress-I360/github-action-reporting/automation@main
with:
PRODUCT_NAME: ${{ inputs.quality-product-name }}
TESTING_TYPE: ${{ inputs.quality-testing-type }}
SERVICE_NAME: ${{ inputs.quality-service-name }}
JUNIT_REPORT: ${{ inputs.quality-junit-report }}
# irfan:
# runs-on: ubuntu-latest-4-cores
# permissions:
# id-token: write
# contents: read
# steps:
# #TODO: Test adding Irfan's quality reporting stage inline here after sonar run (https://github.com/Progress-I360/github-action-reporting)
# # PRODUCT_NAME = [Chef360 | Courier | Inspec]
# - name: Run SonarQube report generation
# if: ${{ inputs.report-to-atlassian-dashboard == true && inputs.visibility == 'internal' }}
# uses: Progress-I360/github-action-reporting/sonarqube@main
# with:
# PRODUCT_NAME: ${{ inputs.quality-product-name }}
# SONAR_APP_NAME: ${{ inputs.quality-sonar-app-name }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

# # TESTING_TYPE = [Unit | Integration | e2e | api | Performance | Security]
# # ENVIRONMENT = [DEV | STAGE | PROD] (optional)
# - name: Run report generation
# if: ${{ inputs.report-to-atlassian-dashboard == true && inputs.report-unit-test-coverage == true && inputs.visibility == 'internal' }}
# uses: Progress-I360/github-action-reporting/automation@main
# with:
# PRODUCT_NAME: ${{ inputs.quality-product-name }}
# TESTING_TYPE: ${{ inputs.quality-testing-type }}
# SERVICE_NAME: ${{ inputs.quality-service-name }}
# JUNIT_REPORT: ${{ inputs.quality-junit-report }}
175 changes: 90 additions & 85 deletions .github/workflows/sonarqube-internal-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,95 +76,100 @@ jobs:
# echo "Quality JUnit report set to ${{ inputs.quality-junit-report }}"
# echo "Go private modules set to ${{ inputs.go-private-modules }}"

# MOVE INLINE - to main-PR-checkin

checkout:
name: 'Checkout code'
disabled-notice:
name: 'Steps disabled'
runs-on: ubuntu-latest
steps:
- name: Configure git for private modules
if: ${{ inputs.visibility == 'internal' }}
env:
GOPRIVATE: ${{ inputs.go-private-modules }} # github.com/progress-platform-services/*
run: git config --global url."https://${{ secrets.GH_TOKEN }}@github.com/".insteadOf "https://github.com/"
continue-on-error: true
- name: checkout
# removed: if: ${{ inputs.perform-build == true && inputs.visibility == 'internal' }} -- this is internal, so always do checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Echo disabled notice
run: echo "All other steps in this workflow have been disabled."
Comment on lines 82 to +84

build:
runs-on: ubuntu-latest-4-cores
permissions:
id-token: write
contents: read
steps:
- name: Set up Go
if: ${{ inputs.perform-build == true && inputs.language == 'Go' }}
uses: actions/setup-go@v5
with:
go-version: 'stable'
# go-version: 1.24.2
check-latest: true
# checkout:
# name: 'Checkout code'
# runs-on: ubuntu-latest
# steps:
# - name: Configure git for private modules
# if: ${{ inputs.visibility == 'internal' }}
# env:
# GOPRIVATE: ${{ inputs.go-private-modules }} # github.com/progress-platform-services/*
# run: git config --global url."https://${{ secrets.GH_TOKEN }}@github.com/".insteadOf "https://github.com/"
# continue-on-error: true
# - name: checkout
# # removed: if: ${{ inputs.perform-build == true && inputs.visibility == 'internal' }} -- this is internal, so always do checkout
# uses: actions/checkout@v6
# with:
# fetch-depth: 0

unit-tests:
runs-on: ubuntu-latest-4-cores
steps:
#TODO: language specific unit tests (also needs paramterization)
# GoLang Unit tests
- name: Generate unit test coverage files
if: ${{ inputs.perform-build == true && inputs.report-unit-test-coverage == true && inputs.language == 'Go' && inputs.visibility == 'internal'}}
run: |
go test -v -coverprofile="coverage.out" ./...
mkdir -p test/coverage
cp coverage.out test/coverage/coverage.out
continue-on-error: true
# build:
# runs-on: ubuntu-latest-4-cores
# permissions:
# id-token: write
# contents: read
# steps:
# - name: Set up Go
# if: ${{ inputs.perform-build == true && inputs.language == 'Go' }}
# uses: actions/setup-go@v5
# with:
# go-version: 'stable'
# # go-version: 1.24.2
# check-latest: true

# Ruby Unit tests
- name: Generate unit test coverage files
if: ${{ inputs.perform-build == true && inputs.report-unit-test-coverage == true && inputs.language == 'Ruby' && inputs.visibility == 'internal'}}
run: |
mkdir -p test/coverage
cp coverage/.resultset.json test/coverage/.resultset.json
coverage-test:
continue-on-error: true
# unit-tests:
# runs-on: ubuntu-latest-4-cores
# steps:
# #TODO: language specific unit tests (also needs paramterization)
# # GoLang Unit tests
# - name: Generate unit test coverage files
# if: ${{ inputs.perform-build == true && inputs.report-unit-test-coverage == true && inputs.language == 'Go' && inputs.visibility == 'internal'}}
# run: |
# go test -v -coverprofile="coverage.out" ./...
# mkdir -p test/coverage
# cp coverage.out test/coverage/coverage.out
# continue-on-error: true

# # Ruby Unit tests
# - name: Generate unit test coverage files
# if: ${{ inputs.perform-build == true && inputs.report-unit-test-coverage == true && inputs.language == 'Ruby' && inputs.visibility == 'internal'}}
# run: |
# mkdir -p test/coverage
# cp coverage/.resultset.json test/coverage/.resultset.json
# coverage-test:
# continue-on-error: true

# name: Coverage from chef-vault
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v6
# - name: Set up ruby 3.1
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: 3.1
# bundler-cache: true
# - name: run specs
# run: bundle exec rake spec --trace
# - name: Simplecov Report
# uses: aki77/simplecov-report-action@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# failedThreshold: 90
# resultPath: coverage/.last_run.json
# # name: Coverage from chef-vault
# # runs-on: ubuntu-22.04
# # steps:
# # - uses: actions/checkout@v6
# # - name: Set up ruby 3.1
# # uses: ruby/setup-ruby@v1
# # with:
# # ruby-version: 3.1
# # bundler-cache: true
# # - name: run specs
# # run: bundle exec rake spec --trace
# # - name: Simplecov Report
# # uses: aki77/simplecov-report-action@v1
# # with:
# # token: ${{ secrets.GITHUB_TOKEN }}
# # failedThreshold: 90
# # resultPath: coverage/.last_run.json

SonarQube:
runs-on: ubuntu-latest-4-cores
permissions:
id-token: write
contents: read
steps:
- name: checkout
# removed: if: ${{ inputs.perform-build == true && inputs.visibility == 'internal' }} -- this is internal, so always do checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: SonarQube Scan
# if: ${{ inputs.perform-build == true && inputs.report-unit-test-coverage == true && inputs.visibility == 'internal' }} -- removing caveat,should be responsibility of caller
uses: sonarsource/sonarqube-scan-action@v5.3.1
# was uses: sonarsource/sonarqube-scan-action@v5.1.0
# was uses: sonarsource/sonarqube-scan-action@master
continue-on-error: true
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# SonarQube:
# runs-on: ubuntu-latest-4-cores
# permissions:
# id-token: write
# contents: read
# steps:
# - name: checkout
# # removed: if: ${{ inputs.perform-build == true && inputs.visibility == 'internal' }} -- this is internal, so always do checkout
# uses: actions/checkout@v6
# with:
# fetch-depth: 0
# - name: SonarQube Scan
# # if: ${{ inputs.perform-build == true && inputs.report-unit-test-coverage == true && inputs.visibility == 'internal' }} -- removing caveat,should be responsibility of caller
# uses: sonarsource/sonarqube-scan-action@v5.3.1
# # was uses: sonarsource/sonarqube-scan-action@v5.1.0
# # was uses: sonarsource/sonarqube-scan-action@master
# continue-on-error: true
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
99 changes: 54 additions & 45 deletions .github/workflows/sonarqube-public-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,60 +56,69 @@ on:
type: string

jobs:
SonarQube:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
# SonarQube:
# runs-on: ubuntu-latest
# permissions:
# id-token: write
# contents: read

# steps:

disabled-notice:
name: 'Steps disabled'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Echo disabled notice
run: echo "All other steps in this workflow have been disabled."
Comment on lines 70 to +72


# - name: Checkout code
# uses: actions/checkout@v6
# with:
# fetch-depth: 0

# # from Confluence, with @latest version of the action
# # - name: Prepare Secrets and Login into Azure
# # id: get-aad-secret
# # uses: 'prgs-community/githubactions-reusableworkflow-sonarqube/.github/actions/azure-login@latest'
# # with:
# # akeyless-access-id: '${{ secrets.AKEYLESS_JWT_ID }}'

# from Confluence, with @latest version of the action
# - name: Prepare Secrets and Login into Azure
# id: get-aad-secret
# uses: 'prgs-community/githubactions-reusableworkflow-sonarqube/.github/actions/azure-login@latest'
# uses: 'chef/common-github-actions/.github/actions/azure-login@main'
# continue-on-error: true
# with:
# akeyless-access-id: '${{ secrets.AKEYLESS_JWT_ID }}'

- name: Prepare Secrets and Login into Azure
id: get-aad-secret
uses: 'chef/common-github-actions/.github/actions/azure-login@main'
continue-on-error: true
with:
akeyless-access-id: '${{ secrets.AKEYLESS_JWT_ID }}'

- name: Add runner IP to Firewall List
uses: chef/common-github-actions/.github/actions/update-firewall-rule@main
continue-on-error: true
with:
action-to-execute: add
# - name: Add runner IP to Firewall List
# uses: chef/common-github-actions/.github/actions/update-firewall-rule@main
# continue-on-error: true
# with:
# action-to-execute: add

- name: Wait 30 sec
shell: bash
run: |
sleep 30
# - name: Wait 30 sec
# shell: bash
# run: |
# sleep 30

- name: SonarQube Scan
if: ${{ inputs.visibility == 'public' }}
uses: sonarsource/sonarqube-scan-action@v5.3.1
# was uses: sonarsource/sonarqube-scan-action@v5.1.0
continue-on-error: true
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# - name: SonarQube Scan
# if: ${{ inputs.visibility == 'public' }}
# uses: sonarsource/sonarqube-scan-action@v5.3.1
# # was uses: sonarsource/sonarqube-scan-action@v5.1.0
# continue-on-error: true
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

- name: Remove Storage Firewall Rule
if: always()
uses: chef/common-github-actions/.github/actions/update-firewall-rule@main
with:
action-to-execute: remove
# - name: Remove Storage Firewall Rule
# if: always()
# uses: chef/common-github-actions/.github/actions/update-firewall-rule@main
# with:
# action-to-execute: remove

- name: logout
if: always()
shell: bash
run: |
az logout
# - name: logout
# if: always()
# shell: bash
# run: |
# az logout