-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f37fa0
commit 5e71287
Showing
7 changed files
with
116 additions
and
86 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,79 @@ | ||
name: Analysis | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
types: ["opened", "reopened", "synchronize", "ready_for_review"] | ||
schedule: | ||
- cron: "0 12 * * 0" # 4 AM PST = 12 PM UDT, runs sundays | ||
workflow_dispatch: | ||
|
||
jobs: | ||
CodeQL: | ||
name: CodeQL | ||
if: github.event_name != 'pull_request' || !github.event.pull_request.draft | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
language: ["go", "java", "javascript", "python"] | ||
include: | ||
- language: "go" | ||
working-directory: backend-go | ||
build: | | ||
sed -i '/^toolchain .*$/d' go.mod | ||
go install github.com/swaggo/swag/cmd/swag@latest | ||
CGO_ENABLED=0 GOOS=linux go build -v | ||
- language: "java" | ||
working-directory: backend-java | ||
build: ./mvnw package -Pnative -DskipTests | ||
- language: "javascript" | ||
- language: "python" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Autobuild | ||
if: ${{ ! matrix.build }} | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- uses: actions/setup-java@v3 | ||
if: ${{ matrix.build && matrix.language == 'java' }} | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
|
||
- name: Build | ||
if: ${{ matrix.build }} | ||
run: ${{ matrix.build }} | ||
working-directory: ${{ matrix.working-directory }} | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{matrix.language}}" | ||
|
||
# https://github.com/marketplace/actions/aqua-security-trivy | ||
trivy: | ||
name: Trivy Security Scan | ||
if: github.event_name != 'pull_request' || !github.event.pull_request.draft | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run Trivy vulnerability scanner in repo mode | ||
uses: aquasecurity/[email protected] | ||
with: | ||
format: "sarif" | ||
output: "trivy-results.sarif" | ||
ignore-unfixed: true | ||
scan-type: "fs" | ||
scanners: "vuln,secret,config" | ||
severity: "CRITICAL,HIGH" | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: "trivy-results.sarif" |
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
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
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
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 |
---|---|---|
@@ -1,24 +1,21 @@ | ||
name: Unit Tests and Analysis | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
types: ["opened", "reopened", "synchronize", "ready_for_review"] | ||
push: | ||
branches: | ||
- main | ||
branches: ["main"] | ||
schedule: | ||
- cron: "0 11 * * 0" # 3 AM PST = 11 PM UDT, runs sundays | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tests-java: | ||
name: Quarkus API Unit Tests | ||
java: | ||
name: Java | ||
if: github.event_name != 'pull_request' || !github.event.pull_request.draft | ||
runs-on: ubuntu-22.04 | ||
defaults: | ||
|
@@ -38,29 +35,25 @@ jobs: | |
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
strategy: | ||
matrix: | ||
distribution: ["temurin"] | ||
java-version: ["17"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: ${{ matrix.distribution }} | ||
java-version: ${{ matrix.java-version }} | ||
distribution: "temurin" | ||
java-version: "17" | ||
- name: Cache local Maven repository | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Run unit tests | ||
run: mvn -f pom.xml clean package | ||
|
||
tests-python: | ||
name: Python API Unit Tests | ||
python: | ||
name: Python | ||
if: github.event_name != 'pull_request' || !github.event.pull_request.draft | ||
runs-on: ubuntu-22.04 | ||
defaults: | ||
|
@@ -80,17 +73,12 @@ jobs: | |
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
strategy: | ||
matrix: | ||
python-version: ["3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: "3.11" | ||
|
||
- name: cache poetry install | ||
uses: actions/cache@v3 | ||
|
@@ -119,8 +107,8 @@ jobs: | |
run: | | ||
poetry run pytest | ||
tests: | ||
name: Unit Tests | ||
javascript: | ||
name: JavaScript | ||
if: github.event_name != 'pull_request' || !github.event.pull_request.draft | ||
runs-on: ubuntu-22.04 | ||
services: | ||
|
@@ -167,26 +155,3 @@ jobs: | |
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info | ||
sonar_token: ${{ secrets[matrix.token] }} | ||
triggers: ${{ matrix.triggers }} | ||
|
||
# https://github.com/marketplace/actions/aqua-security-trivy | ||
trivy: | ||
name: Trivy Security Scan | ||
if: github.event_name != 'pull_request' || !github.event.pull_request.draft | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run Trivy vulnerability scanner in repo mode | ||
uses: aquasecurity/[email protected] | ||
with: | ||
format: "sarif" | ||
output: "trivy-results.sarif" | ||
ignore-unfixed: true | ||
scan-type: "fs" | ||
scanners: "vuln,secret,config" | ||
severity: "CRITICAL,HIGH" | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: "trivy-results.sarif" |
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
Binary file not shown.