Skip to content

entgql: fixed go-fmt (#555) #2381

entgql: fixed go-fmt (#555)

entgql: fixed go-fmt (#555) #2381

Workflow file for this run

# Copyright (c) 2004-present Facebook All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
name: Continuous Integration
on:
pull_request:
push:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Run linters
uses: golangci/[email protected]
with:
version: v1.55.2
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.20', '1.21']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
run: go test -race ./...
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.21'
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: arduino/setup-protoc@v1
with:
version: v3.19.4
- name: Install protoc plugins
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
- name: Install protoc-gen-entgrpc
working-directory: entproto/cmd/protoc-gen-entgrpc
run: go install
- name: Install protoc-gen-ent
working-directory: entproto/cmd/protoc-gen-ent
run: go install
- name: Run go generate
run: go generate ./...
- name: Go mod tidy
run: go mod tidy
- name: Check generated files
run: |
status=$(git status --porcelain | cat)
if [ -n "$status" ]; then
echo "you need to run 'go generate ./...' and commit the changes"
echo "$status"
git diff
exit 1
fi