Skip to content

Commit

Permalink
Add OSSF Scorecard and Go unit test workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
raniellyferreira committed Oct 2, 2024
1 parent a167a3d commit e8750f5
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: OSSF Scorecard

on:
schedule:
- cron: "0 0 * * 0" # Executa semanalmente aos domingos
workflow_dispatch:

jobs:
scorecard:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run OSSF Scorecard
uses: ossf/scorecard-action@v2
with:
results_file: results.sarif
# Opções adicionais podem ser configuradas aqui

- name: Upload Scorecard Results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
26 changes: 26 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Go Unit Test

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: 1.20

- name: Install dependencies
run: go mod download

- name: Run unit tests
run: make test-unit
2 changes: 1 addition & 1 deletion internal/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package utils_test
import (
"testing"

"github.com/raniellyferreira/rotate-files/pkg/utils"
"github.com/raniellyferreira/rotate-files/internal/utils"
)

func TestGetAccountContainerAndPath(t *testing.T) {
Expand Down

0 comments on commit e8750f5

Please sign in to comment.