-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
update go-grpc
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,57 +18,79 @@ on: | |
|
||
env: | ||
VAULT_ADDR: https://vault.eng.aserto.com/ | ||
BUF_REPO: "buf.build/aserto-dev/aserto" | ||
|
||
BUF_VERSION: "1.34.0" | ||
BUF_BETA_SUPPRESS_WARNINGS: 1 | ||
GO_VERSION: "1.22" | ||
GO_LANGCI_LINT_VERSION: "v1.56.2" | ||
GO_TESTSUM_VERSION: "1.11.0" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Read Configuration | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Read Configuration | ||
uses: hashicorp/vault-action@v3 | ||
id: vault | ||
with: | ||
url: ${{ env.VAULT_ADDR }} | ||
token: ${{ secrets.VAULT_TOKEN }} | ||
secrets: | | ||
kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY; | ||
kv/data/buf.build "ASERTO_BUF_TOKEN" | ASERTO_BUF_TOKEN; | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Go | ||
kv/data/github "USERNAME" | GH_USERNAME; | ||
kv/data/github "READ_WRITE_TOKEN" | GH_TOKEN; | ||
kv/data/buf.build "ASERTO_BUF_USER" | BUF_USER; | ||
kv/data/buf.build "ASERTO_BUF_TOKEN" | BUF_TOKEN; | ||
- | ||
name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Install dependencies | ||
- | ||
name: Setup buf | ||
uses: bufbuild/buf-setup-action@v1 | ||
with: | ||
version: ${{ env.BUF_VERSION }} | ||
github_token: ${{ github.token }} | ||
buf_user: ${{ steps.vault.outputs.BUF_USER }} | ||
buf_api_token: ${{ steps.vault.outputs.BUF_TOKEN}} | ||
- | ||
name: Delete generated code | ||
run: | | ||
mkdir -p $HOME/.ssh | ||
umask 0077 && echo -e "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa | ||
ssh-keyscan github.com >> $HOME/.ssh/known_hosts | ||
git config --global url."[email protected]:".insteadOf https://github.com/ | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Aserto Bot" | ||
eval `ssh-agent` | ||
ssh-add $HOME/.ssh/id_rsa | ||
go run mage.go deps | ||
- name: Clean generated code | ||
run: go run mage.go clean | ||
|
||
- name: Setup Buf Registry | ||
run: echo -e "machine buf.build\npassword ${ASERTO_BUF_TOKEN}" >> ~/.netrc | ||
|
||
- name: Generate | ||
run: go run mage.go generate | ||
|
||
- name: Commit changes | ||
rm -rf ./aserto | ||
- | ||
name: Get latest version tag from Buf Registry | ||
id: buf-latest | ||
run: | | ||
echo "VERSION=$(buf beta registry label list ${BUF_REPO} --format json --reverse | jq -r '.results[0].name')" >> "$GITHUB_OUTPUT" | ||
- | ||
name: Buf Generate | ||
run: | | ||
echo "${{ env.BUF_REPO }}:${{ steps.buf-latest.outputs.VERSION }}" | ||
buf generate ${{ env.BUF_REPO }}:${{ steps.buf-latest.outputs.VERSION }} | ||
- | ||
name: Lint | ||
uses: golangci/golangci-lint-action@v4 | ||
with: | ||
version: ${{ env.GO_LANGCI_LINT_VERSION }} | ||
args: --timeout=30m | ||
- | ||
name: Test Setup | ||
uses: gertd/[email protected] | ||
with: | ||
gotestsum_version: ${{ env.GO_TESTSUM_VERSION }} | ||
- | ||
name: Test | ||
run: | | ||
gotestsum --format short-verbose -- -count=1 -parallel=1 -v -timeout=240s -coverprofile=cover.out -coverpkg=./... ./... | ||
- | ||
name: Commit changes | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.