generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bring over recent workflow improvements (#656)
Co-authored-by: Chris Berg <[email protected]>
- Loading branch information
1 parent
f8c1a73
commit 8500ff1
Showing
11 changed files
with
90 additions
and
214 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,4 +1,4 @@ | ||
name: Unit Tests and Analysis | ||
name: Analysis | ||
|
||
on: | ||
pull_request: | ||
|
@@ -10,15 +10,51 @@ on: | |
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- "**.md" | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
codeql: | ||
name: CodeQL | ||
if: github.event_name != 'pull_request' || !github.event.pull_request.draft | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: github/codeql-action/init@v2 | ||
with: | ||
languages: javascript | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
|
||
# https://github.com/marketplace/actions/aqua-security-trivy | ||
trivy: | ||
name: Security Scan | ||
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" | ||
|
||
tests: | ||
name: Unit Tests | ||
if: github.event_name != 'pull_request' || !github.event.pull_request.draft | ||
|
@@ -33,7 +69,7 @@ jobs: | |
token: SONAR_TOKEN_BACKEND | ||
- dir: backend/dops | ||
sonar_projectKey: bcgov_onroutebc_backend | ||
token: SONAR_TOKEN_BACKEND | ||
token: SONAR_TOKEN_BACKEND | ||
- dir: frontend | ||
sonar_projectKey: bcgov_onroutebc_frontend | ||
token: SONAR_TOKEN_FRONTEND | ||
|
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,70 +1,18 @@ | ||
name: Merge to Main | ||
name: Merge | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- feature/deploy.yml | ||
paths-ignore: | ||
- ".github/ISSUE_TEMPLATE/*" | ||
- "**.md" | ||
workflow_run: | ||
workflows: [PR Closed] | ||
types: [completed] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
codeql: | ||
name: Semantic Code Analysis | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Initialize | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: javascript | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
|
||
# https://github.com/marketplace/actions/aqua-security-trivy | ||
trivy: | ||
name: Security Scan | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- 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" | ||
|
||
deploys-test: | ||
name: Deploy images to test | ||
needs: | ||
- codeql | ||
- trivy | ||
uses: ./.github/workflows/deploy.yml | ||
with: | ||
environment: 'test' | ||
|
@@ -96,7 +44,7 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} # checkout the correct branch name | ||
fetch-depth: 0 # fetch the whole repo history | ||
|
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,4 +1,4 @@ | ||
name: Pull Request | ||
name: PR | ||
|
||
on: | ||
pull_request: | ||
|
@@ -42,27 +42,18 @@ jobs: | |
strategy: | ||
matrix: | ||
package: [backend/vehicles, backend/dops, frontend] | ||
include: | ||
- package: backend/vehicles | ||
triggers: ('backend/vehicles/') | ||
- package: backend/dops | ||
triggers: ('backend/dops/') | ||
- package: frontend | ||
triggers: ('frontend/') | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/checkout@v4 | ||
- uses: bcgov-nr/[email protected] | ||
with: | ||
package: ${{ matrix.package }} | ||
tag: ${{ github.event.number }} | ||
tag_fallback: test | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
triggers: ${{ matrix.triggers }} | ||
triggers: ( '${{ matrix.package }}/') | ||
|
||
deploys: | ||
needs: | ||
- builds | ||
needs: [builds] | ||
uses: ./.github/workflows/deploy.yml | ||
with: | ||
environment: 'dev' | ||
|
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
Oops, something went wrong.