Skip to content

Commit

Permalink
github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bbengfort committed Aug 3, 2023
1 parent d1313ae commit 2b885c0
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
### Scope of changes

[Brief Description of the Changes]

### Type of change

- [ ] new feature
- [ ] bug fix
- [ ] documentation
- [ ] testing
- [ ] technical debt
- [ ] other (describe)

### Acceptance criteria

Describe how reviewers can test this change to be sure that it works correctly. Add a checklist if possible.

### Author checklist

- [ ] I have manually tested the change and/or added automation in the form of unit tests or integration tests
- [ ] I have updated the dependencies list
- [ ] I have recompiled and included new protocol buffers to reflect changes I made
- [ ] I have added new test fixtures as needed to support added tests
- [ ] Check this box if a reviewer can merge this pull request after approval (leave it unchecked if you want to do it yourself)
- [ ] I have moved the associated Shortcut story to "Ready for Review"
93 changes: 93 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI
on:
push:
branches:
- main
- "v*"
tags:
- "v*"
pull_request:

jobs:
lint:
name: Go Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Install Staticcheck
run: go install honnef.co/go/tools/cmd/[email protected]

- name: Checkout Code
uses: actions/checkout@v3

- name: Lint Go Code
run: staticcheck ./...

test:
name: Go Test
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}/go
GOBIN: ${{ github.workspace }}/go/bin
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/bbengfort/noaalert
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Cache Speedup
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Checkout Code
uses: actions/checkout@v3
with:
path: ${{ env.GOPATH }}/src/github.com/bbengfort/noaalert

- name: Run Unit Tests
run: go test -v -coverprofile=coverage.txt -covermode=atomic --race ./...

- name: Coverage Report
run: go tool cover -func=coverage.txt

build:
name: Go Build
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}/go
GOBIN: ${{ github.workspace }}/go/bin
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/bbengfort/noaalert
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Cache Speedup
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Checkout Code
uses: actions/checkout@v3
with:
path: ${{ env.GOPATH }}/src/github.com/bbengfort/noaalert

- name: Build
run: go build ./cmd/...

0 comments on commit 2b885c0

Please sign in to comment.