Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI bot to automatically run go generate and create PRs #159

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/regenerate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Regenerate bindings
on:
# Uncomment during development to make testing easier
#push:
schedule:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
# Runs on Mon,Thu. For help with cron syntax, see https://crontab.guru/
- cron: '33 1 * * 1,4'

jobs:
regenerate:
runs-on: ubuntu-latest
steps:
- name: Install Mesa
run: |
sudo apt-get update
sudo apt-get install \
libxcursor-dev \
libxrandr-dev \
libxinerama-dev \
libxi-dev \
libgl1-mesa-dev

- name: Checkout gl
uses: actions/checkout@v4
with:
path: gl

- name: Checkout glow
uses: actions/checkout@v4
with:
repository: go-gl/glow
path: glow

- name: Checkout examples
uses: actions/checkout@v4
with:
repository: go-gl/example
path: example

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 'stable'

- name: Regenerate files
run: |
go work init
go work use gl/
go work use glow/
go work use example/

cd gl
# Clean up previously generated files
rm -r */
go generate -tags=gen .
go test -v -race ./...
cd ..

# Test for API breakage
go test ./example/...

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
path: gl
commit-message: Regenerate bindings
author: GitHub <[email protected]>
title: Regenerate bindings
body: |
This pull request was triggered by one of the following events:

- https://github.com/go-gl/glow has been updated
- The output of gofmt has changed in the latest Go version

If checks are not available, you may need to close and reopen this pull request.
[See here for details.][2]

Auto-generated by [create-pull-request][1]

[1]: https://github.com/peter-evans/create-pull-request
[2]: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
branch: regenerate