Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linters and CycloneDX SBOM generation #42

Merged
merged 3 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@ jobs:
with: |
github.com/mostafa/xk6-kafka@latest

- name: Install Go 🧑‍💻
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: actions/setup-go@v3
with:
go-version: '1.18'

- name: Generate CycloneDX SBOM artifacts 📃
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest
cyclonedx-gomod mod -json -licenses -output cyclonedx-xk6-kafka-${{ github.ref_name }}.json

- name: Upload CycloneDX SBOM artifact for go.mod 💾
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: actions/upload-artifact@v3
with:
name: cyclonedx-xk6-kafka-${{ github.ref_name }}.json
path:
cyclonedx-xk6-kafka-${{ github.ref_name }}.json

- name: Create Release 📦
uses: softprops/action-gh-release@v1
with:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ jobs:
with:
go-version: '1.18'

- name: Lint code issues 🚨
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run

- name: Lint security issues 🔒
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
gosec .

- name: Install xk6 and build xk6-kafka 🏗️
run: |
go install go.k6.io/xk6/cmd/xk6@latest
Expand Down