Skip to content

Commit

Permalink
add GH action workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ihatemodels committed Nov 26, 2023
1 parent 8326e49 commit e94bd8d
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: codeql

on:
push:
branches:
- 'main'
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '**/*.yaml'
- '**/*_test.go'
pull_request:
branches:
- 'main'
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '**/*.yaml'
- '**/*_test.go'

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
uses: actions/checkout@v4
-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true
-
name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
-
name: Autobuild
uses: github/codeql-action/autobuild@v2
-
name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
28 changes: 28 additions & 0 deletions .github/workflows/test-mr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Go Test on Pull Request

on:
pull_request:
branches: [ main ]

jobs:
tests:
name: Run Go Tests
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21' # Use the version of Go your project requires

- name: Check out code
uses: actions/checkout@v2

- name: "Run Linters"
uses: golangci/golangci-lint-action@latest
with:
version: latest
args: --verbose

- name: Run tests
run: go test -v ./...

0 comments on commit e94bd8d

Please sign in to comment.