-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.42 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build and Test
on:
pull_request:
push:
branches:
- master
- main
jobs:
build:
strategy:
matrix:
go:
- '1.19'
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: true
- uses: actions/setup-node@v4
with:
node-version: 16
cache: yarn
cache-dependency-path: 'js/yarn.lock'
- run: go generate ./...
- name: Create Pull Request
id: cpr
if: github.event_name == 'pull_request'
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update generated files
base: ${{ github.head_ref }}
branch: regenerate/${{ github.head_ref }}
delete-branch: true
title: "Regenerate files for ${{ github.head_ref }}"
body: |
Update generated files
labels: |
automated
assignees: ${{ !contains(github.actor, '[bot]') && github.actor }}
draft: false
- name: Fail if there were changes
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Generated files don't match, pull request created:"
echo "${{ steps.cpr.outputs.pull-request-url }}"
exit 1
- run: go test ./...
- run: go build ./...