github action push to ecr #20
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: Go unit tests | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Run unit tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: | |
- 1.21.x | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
id: go | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Cache Go Modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go-${{ matrix.go-version }}- | |
- name: Run tests | |
run: go test -v ./... |