-
Notifications
You must be signed in to change notification settings - Fork 151
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
Showing
17 changed files
with
244 additions
and
211 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 |
---|---|---|
@@ -1,27 +1,33 @@ | ||
name: Build HORNET | ||
|
||
on: | ||
push: | ||
branches: | ||
- legacy | ||
- develop-legacy | ||
pull_request: | ||
paths-ignore: | ||
- 'documentation/**' | ||
- 'nfpm/**' | ||
- 'private_tangle/**' | ||
- 'scripts/**' | ||
- 'tools/**' | ||
|
||
jobs: | ||
build: | ||
name: Build HORNET | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v1 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.20' | ||
go-version: "1.20" | ||
id: go | ||
|
||
- name: Print Go version | ||
run: go version | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build HORNET | ||
run: go build -v . |
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,32 +1,42 @@ | ||
|
||
name: "CodeQL" | ||
|
||
on: | ||
# Run this security check every day at 03:00 to find potential new vulnerabilities in the default branch | ||
# Run this security check every day at 03:00 to find potential new vulnerabilities in the develop branch | ||
schedule: | ||
- cron: "0 3 * * *" | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'go' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
with: | ||
# We must fetch at least the immediate parents so that if this is | ||
# a pull request then we can checkout the head. | ||
fetch-depth: 2 | ||
|
||
# If this run was triggered by a pull request event, then checkout | ||
# the head of the pull request instead of the merge commit. | ||
- run: git checkout HEAD^2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
ref: legacy | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: go | ||
languages: ${{ matrix.language }} | ||
queries: security-and-quality | ||
|
||
# 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@v1 | ||
uses: github/codeql-action/analyze@v2 |
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,18 +1,33 @@ | ||
name: GolangCIlint | ||
|
||
on: [pull_request] | ||
on: | ||
push: | ||
branches: | ||
- legacy | ||
pull_request: | ||
paths-ignore: | ||
- 'documentation/**' | ||
- 'docker/**' | ||
- 'nfpm/**' | ||
- 'private_tangle/**' | ||
- 'scripts/**' | ||
- 'tools/**' | ||
|
||
jobs: | ||
golangci-lint: | ||
name: GolangCI-Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: golangci-lint | ||
uses: reviewdog/action-golangci-lint@v1 | ||
uses: reviewdog/action-golangci-lint@v2 | ||
with: | ||
go_version_file: go.mod | ||
version: v1.53.3 | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
golangci_lint_flags: "--timeout=10m" | ||
reporter: "github-pr-review" | ||
reporter: github-pr-check | ||
filter_mode: nofilter | ||
fail_on_error: true |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,54 @@ | ||
name: Test dependencies with Snyk | ||
|
||
on: | ||
# Run this check every day at 03:00 to find potential new vulnerabilities in the develop branch | ||
schedule: | ||
- cron: "0 3 * * *" | ||
|
||
jobs: | ||
snyk-test: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: legacy | ||
|
||
- name: Build HORNET Docker image | ||
run: docker build . --file docker/Dockerfile --tag hornet:latest | ||
|
||
- name: Run Snyk to check for Golang vulnerabilities | ||
uses: snyk/actions/golang@0.3.0 | ||
continue-on-error: true | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
with: | ||
args: --org=gohornet --sarif-file-output=snyk-golang.sarif | ||
|
||
- name: Run Snyk to check for Docker image vulnerabilities | ||
uses: snyk/actions/docker@0.3.0 | ||
continue-on-error: true | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
with: | ||
image: hornet:latest | ||
# Exclude Go app vulns because those are picked up by the previous scan | ||
# For Docker scans, the SARIF is created by default | ||
args: --org=gohornet --file=Dockerfile --exclude-app-vulns | ||
|
||
- name: Upload Golang results to GitHub Code Scanning | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: snyk-golang.sarif | ||
category: snyk-golang | ||
|
||
- name: Upload Docker results to GitHub Code Scanning | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: snyk.sarif | ||
category: snyk-docker |
Oops, something went wrong.