diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..ccfd539 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,32 @@ +name: Lint +on: + push: + branches: + - main + pull_request: + branches: + - main +permissions: + contents: read +jobs: + lint: + strategy: + matrix: + go: [ '1.20' ] + fail-fast: true + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Go ${{ matrix.go }} + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go }} + cache: false + + - name: Run GolangCI-Lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.56.1 + args: --timeout=5m diff --git a/.github/workflows/sec.yml b/.github/workflows/sec.yml new file mode 100644 index 0000000..e0ceeaf --- /dev/null +++ b/.github/workflows/sec.yml @@ -0,0 +1,32 @@ +name: Security Scan + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + contents: read + id-token: write + issues: write + pull-requests: write + +jobs: + TruffleHog: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Secret Scanning + uses: trufflesecurity/trufflehog@main + with: + extra_args: --only-verified diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1a76bf5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: Test + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + test_and_lint: + name: Test, Lint, and Coverage + strategy: + matrix: + go: [ '1.20' ] + os: [ ubuntu-latest ] + fail-fast: true + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Go ${{ matrix.go }} + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go }} + cache: false + + - name: Install dependencies + run: go mod download + + - name: Run tests with coverage + run: go test -race -cover -coverprofile="coverage.out" -covermode=atomic -v ./... + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: ./coverage.out + + - name: Calculate coverage + run: go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}' + id: coverage diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..6e1f364 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @vasayxtx @MikeYast