Skip to content

ci

ci #63

Workflow file for this run

name: ci
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
proto_ref:
proto_sha:
push:
branches:
- main
- v*
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for PRs
pull_request:
env:
VAULT_ADDR: https://vault.eng.aserto.com/
GO_VERSION: "1.19"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Read Configuration
uses: hashicorp/[email protected]
id: vault
with:
url: ${{ env.VAULT_ADDR }}
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
kv/data/buf.build "ASERTO_BUF_TOKEN" | ASERTO_BUF_TOKEN;
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
-
name: Setup caching
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: |
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
if: github.event_name == 'workflow_dispatch'
uses: EndBug/add-and-commit@v7
with:
default_author: github_actions
add: 'aserto'