Skip to content

Commit

Permalink
Add lint and test Github Actions
Browse files Browse the repository at this point in the history
 - Since we don't yet have SDLC pipeline projects for Go libraries or
   for public projects, add in some limited CI validation for PRs to
   this repo including:

   * A build and test stage that generates binaries with the Makefile
     *and* runs make test-coverage to produce coverage (not currently
     used in CI)
   * Linting through the golangci-lint Github Action
  • Loading branch information
ddl-ebrown committed May 26, 2024
1 parent c2f8c49 commit 86e9289
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: golangci-lint

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
33 changes: 33 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: test

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@main
- name: setup
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install dependencies
run: make common-deps
- name: run tests
run: make test-coverage
- name: report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: report
path: test/*.xml
reporter: java-junit

0 comments on commit 86e9289

Please sign in to comment.