Move IAM Service Account Tasks to actions package #6127
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: test-and-build | |
on: | |
pull_request: {} | |
workflow_call: {} | |
jobs: | |
unit-test: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 | |
with: | |
fetch-depth: 0 | |
- name: Cache go-build and mod | |
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2 | |
with: | |
path: | | |
~/.cache/go-build/ | |
~/go/pkg/mod/ | |
key: go-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go- | |
- name: Setup Go | |
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe #v4.1.0 | |
with: | |
go-version: 1.20.x | |
- name: Setup deps | |
run: | | |
make install-build-deps | |
- name: Unit test | |
run: | | |
PATH=$PATH:$(go env GOPATH)/bin make build | |
PATH=$PATH:$(go env GOPATH)/bin make unit-test-no-generate | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 | |
with: | |
fetch-depth: 0 | |
- name: Cache go-build and mod | |
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2 | |
with: | |
path: | | |
~/.cache/go-build/ | |
~/go/pkg/mod/ | |
key: go-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go- | |
- name: Setup Go | |
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe #v4.1.0 | |
with: | |
go-version: 1.20.x | |
- name: Setup deps | |
run: | | |
make install-build-deps | |
- name: Lint | |
run: | | |
PATH=$PATH:$(go env GOPATH)/bin make lint | |
image: | |
name: Build and check image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 | |
with: | |
fetch-depth: 0 | |
- name: Cache go-build and mod | |
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2 | |
with: | |
path: | | |
~/.cache/go-build/ | |
~/go/pkg/mod/ | |
key: go-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go- | |
- name: Setup Go | |
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe #v4.1.0 | |
with: | |
go-version: 1.20.x | |
- name: Setup deps | |
run: | | |
make install-build-deps | |
- name: build | |
run: | | |
PATH=$PATH:$(go env GOPATH)/bin make -f Makefile.docker check-build-image-manifest-up-to-date |