mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-02-14 09:59:57 +00:00
87 lines
2.7 KiB
YAML
87 lines
2.7 KiB
YAML
name: Coverage
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
pull_request:
|
|
types: [opened, reopened, synchronize]
|
|
branches:
|
|
- "main"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
compliance:
|
|
name: "License Compliance"
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: "Checkout Code"
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
- name: Check secret
|
|
id: checksecret
|
|
uses: ./.github/actions/exists
|
|
with:
|
|
value: ${{ secrets.FOSSA_API_KEY }}
|
|
- name: "Run FOSSA Scan"
|
|
if: steps.checksecret.outputs.result == 'true'
|
|
uses: fossas/fossa-action@3ebcea1862c6ffbd5cf1b4d0bd6b3fe7bd6f2cac # v1.7.0
|
|
with:
|
|
api-key: ${{ secrets.FOSSA_API_KEY }}
|
|
- name: "Run FOSSA Test"
|
|
if: steps.checksecret.outputs.result == 'true'
|
|
uses: fossas/fossa-action@3ebcea1862c6ffbd5cf1b4d0bd6b3fe7bd6f2cac # v1.7.0
|
|
with:
|
|
api-key: ${{ secrets.FOSSA_API_KEY }}
|
|
run-tests: true
|
|
sast:
|
|
name: "SAST"
|
|
runs-on: ubuntu-24.04
|
|
env:
|
|
GO111MODULE: on
|
|
permissions:
|
|
security-events: write
|
|
actions: read
|
|
contents: read
|
|
steps:
|
|
- name: Checkout Source
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
- name: Run Gosec Security Scanner
|
|
uses: securego/gosec@15d5c61e866bc2e2e8389376a31f1e5e09bde7d8 # v2.22.9
|
|
with:
|
|
args: '-no-fail -fmt sarif -out gosec.sarif ./...'
|
|
- name: Upload SARIF file
|
|
uses: github/codeql-action/upload-sarif@6fd4ceb7bbb8ec2746fd4d3a64b77787dffd9afc
|
|
with:
|
|
sarif_file: gosec.sarif
|
|
unit_tests:
|
|
name: "Unit tests"
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
- name: Unit Test
|
|
run: make test
|
|
- name: Check secret
|
|
id: checksecret
|
|
uses: ./.github/actions/exists
|
|
with:
|
|
value: ${{ secrets.CODECOV_TOKEN }}
|
|
- name: Upload Report to Codecov
|
|
if: ${{ steps.checksecret.outputs.result == 'true' }}
|
|
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
slug: projectcapsule/capsule
|
|
files: ./coverage.out
|
|
fail_ci_if_error: true
|
|
verbose: true
|