-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create code-quality-security-tests.yml
- Loading branch information
1 parent
c0d977e
commit a283d4b
Showing
1 changed file
with
111 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: "Code Quality & Security" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- main | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
pull-requests: read | ||
actions: read | ||
security-events: write | ||
|
||
jobs: | ||
# Job to execute CodeQL | ||
CodeQL: | ||
runs-on: ubuntu-latest | ||
name: Run CodeQL to Midaz | ||
timeout-minutes: 360 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- language: go | ||
build-mode: autobuild | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go environment | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.23' | ||
cache: false | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
build-mode: ${{ matrix.build-mode }} | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:${{ matrix.language }}" | ||
|
||
# Job to execute the security Step - GoSec | ||
GoSec: | ||
runs-on: ubuntu-latest | ||
name: Run GoSec to Midaz | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go environment | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.23' | ||
cache: false | ||
|
||
- name: Gosec Scanner | ||
uses: securego/gosec@master | ||
with: | ||
args: ./... | ||
|
||
# Job to execute Lint Step - GoLangCI-Lint | ||
GoLangCI-Lint: | ||
runs-on: ubuntu-latest | ||
name: Run GoLangCI-Lint to Midaz | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go environment | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.23' | ||
cache: false | ||
|
||
- name: GoLangCI-Lint | ||
uses: golangci/golangci-lint-action@v4 | ||
with: | ||
version: latest | ||
|
||
# Job to execute Unit Tests | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
name: Run Unit Tests to Midaz | ||
env: | ||
WORKING_DIR: components/ledger | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go environment | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.23' | ||
cache: false | ||
|
||
- name: Unit Tests | ||
working-directory: ${{ env.WORKING_DIR }} | ||
shell: bash | ||
run: make test |