chore(deps): update google.golang.org/genproto digest to 1744710 #3281
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: Showcase CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
regenerate: | |
runs-on: ubuntu-latest | |
outputs: | |
modified_files: ${{ steps.mod.outputs.modified_files }} | |
steps: | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19.2' | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
- name: Install external generators | |
run: | | |
go install github.com/golang/protobuf/protoc-gen-go@latest | |
go install github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_cli@latest | |
go install github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@latest | |
- uses: actions/checkout@v3 | |
- name: Checkout common protos | |
run: git submodule init && git submodule update | |
- name: Download go deps | |
run: go mod download | |
- name: Install REST server generator | |
run: go install ./util/cmd/protoc-gen-go_rest_server | |
- name: Regenerate sources | |
run: go run ./util/cmd/compile_protos | |
- name: Capture modified files | |
id: mod | |
run: | | |
files=$(git ls-files --deleted --modified --other --directory --exclude-standard cmd client server/genproto server/genrest) | |
echo ::set-output name=modified_files::$files | |
- name: Prepare regenerated sources | |
if: steps.mod.outputs.modified_files | |
run: tar czf regen.tgz ${{ steps.mod.outputs.modified_files }} | |
- uses: actions/upload-artifact@v3 | |
if: steps.mod.outputs.modified_files | |
with: | |
name: regenerated-sources | |
path: regen.tgz | |
lint: | |
needs: regenerate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19.2' | |
- name: Install golint | |
run: go install golang.org/x/lint/golint@latest | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
if: needs.regenerate.outputs.modified_files | |
with: | |
name: regenerated-sources | |
- name: Expand regen archive | |
if: needs.regenerate.outputs.modified_files | |
run: | | |
tar xvzf regen.tgz | |
rm regen.tgz | |
- name: Check formatting | |
run: gofmt -l ./server/services > gofmt.txt && ! [ -s gofmt.txt ] | |
if: ${{ always() }} | |
- name: Lint service implementations | |
run: golint ./server/services >> golint.txt && ! [ -s golint.txt ] | |
if: ${{ always() }} | |
- name: Vet service implementations | |
# The mod download is there to prevent go vet from logging mod downloads | |
# which would mess up the empty vetting results check. | |
run: go mod download && go vet ./server/services 2> govet.txt && ! [ -s govet.txt ] | |
if: ${{ always() }} | |
- uses: actions/upload-artifact@v3 | |
if: ${{ always() }} | |
with: | |
name: linting-results | |
path: | | |
gofmt.txt | |
golint.txt | |
govet.txt | |
tests: | |
needs: regenerate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19.2' | |
- uses: actions/download-artifact@v3 | |
if: needs.regenerate.outputs.modified_files | |
with: | |
name: regenerated-sources | |
- name: Expand regen archive | |
if: needs.regenerate.outputs.modified_files | |
run: | | |
tar xvzf regen.tgz | |
rm regen.tgz | |
- name: Run unit tests | |
run: go test ./... | |
- name: Run server coverage | |
run: go test ./server/... -coverprofile=coverage.txt -covermode=atomic | |
# Disabled indefinitely. | |
# - uses: codecov/codecov-action@v1 | |
# with: | |
# files: ./coverage.txt | |
# flags: unittests | |
probes: | |
needs: regenerate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19.2' | |
- uses: actions/download-artifact@v3 | |
if: needs.regenerate.outputs.modified_files | |
with: | |
name: regenerated-sources | |
- name: Expand regen archive | |
if: needs.regenerate.outputs.modified_files | |
run: | | |
tar xvzf regen.tgz | |
rm regen.tgz | |
- name: Install gapic-showcase CLI | |
run: go install ./cmd/gapic-showcase | |
- name: Probe gRPC and REST servers | |
run: | | |
gapic-showcase run & | |
gapic-showcase echo echo --response content --response.content "hello!" | |
GRPC_EXIT_CODE=$? | |
STATUSCODE=$(curl --silent --output /dev/null --write-out "%{http_code}" http://localhost:7469/hello) | |
echo "gRPC exit code: $GRPC_EXIT_CODE" | |
echo "REST status code: $STATUSCODE" | |
[ $STATUSCODE = "200" ] && [ GRPC_EXIT_CODE != 0 ] | |
# Disabled until https://github.com/googleapis/gapic-generator-typescript/pull/955 is merged/released. | |
# typescript-smoke-test: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - uses: actions/setup-node@v2 | |
# with: | |
# node-version: '12' | |
# - name: Run gapic-generator-typescript | |
# run: | | |
# mkdir tsout | |
# docker run --rm --user $UID \ | |
# --mount type=bind,source="$(pwd)"/schema,destination=/in/protos/google/showcase/v1beta1,readonly \ | |
# --mount type=bind,source="$(pwd)"/tsout,destination=/out/ \ | |
# gcr.io/gapic-images/gapic-generator-typescript:latest | |
# - name: Run auto-generated tests | |
# run: | | |
# cd tsout | |
# npm install | |
# npm test | |
# npm run system-test | |
protobufjs-load-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '12' | |
- name: Install protobuf loader | |
run: npm install google-proto-files | |
- name: Verify protos can be loaded by protobufjs | |
run: | | |
node -e "require('google-proto-files').loadSync('schema/google/showcase/v1beta1/echo.proto');" | |
node -e "require('google-proto-files').loadSync('schema/google/showcase/v1beta1/identity.proto');" | |
node -e "require('google-proto-files').loadSync('schema/google/showcase/v1beta1/messaging.proto');" | |
node -e "require('google-proto-files').loadSync('schema/google/showcase/v1beta1/testing.proto');" | |
node -e "require('google-proto-files').loadSync('schema/google/showcase/v1beta1/compliance.proto');" | |
node -e "require('google-proto-files').loadSync('schema/google/showcase/v1beta1/sequence.proto');" | |
push-generated-sources: | |
needs: [regenerate, lint, tests, probes] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' && needs.regenerate.outputs.modified_files | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/download-artifact@v3 | |
with: | |
name: regenerated-sources | |
- name: Expand regen archive | |
run: | | |
tar xvzf regen.tgz | |
rm regen.tgz | |
- uses: googleapis/code-suggester@v4 | |
env: | |
ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }} | |
with: | |
command: pr | |
upstream_owner: googleapis | |
upstream_repo: gapic-showcase | |
description: 'Regenerated sources resulting from most recent commit to main' | |
title: 'chore: regenerate sources' | |
message: 'chore: regenerate sources' | |
primary: 'main' | |
branch: regen | |
git_dir: '.' | |
force: true | |
- name: Add automerge label to pull request | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.addLabels({ | |
issue_number: ${{ steps.code_suggester.outputs.pull }}, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['automerge'] | |
}) |