Add Github action for the common logging library #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run unit tests | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'common/**' | |
pull_request: | |
paths: | |
- 'common/**' | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
/home/runner/work/common/bin | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Set up go environment | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.5 | |
- name: Run unit tests | |
run: make test | |