Skip to content

Commit

Permalink
Add Github Workflow for checking Go API compatibility on PRs
Browse files Browse the repository at this point in the history
It'll automatically set the semver label for a given PR.
However we don't detect (yet) whether it's in actual Gophercloud code
or in the tests.
  • Loading branch information
EmilienM committed Aug 28, 2023
1 parent c654d07 commit 0d0b48f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 21 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/semver-auto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Add PR semver labels on push
on:
pull_request_target:
types: [synchronize]
jobs:
go-apidiff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-go@v2
with:
go-version: '1'

- name: Remove the semver label
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
with:
labels: |
semver:patch
semver:minor
semver:major
github_token: ${{ github.token }}

- name: Checking Go API Compatibility
id: go-apidiff
uses: joelanford/go-apidiff@v0.7.0

- name: Add semver:patch label
if: always() && steps.go-apidiff.outputs.semver-type == 'patch'
uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: semver:patch

- name: Add semver:minor label
if: always() && steps.go-apidiff.outputs.semver-type == 'minor'
uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: semver:minor

- name: Add semver:major label
if: always() && steps.go-apidiff.outputs.semver-type == 'major'
uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: semver:major
21 changes: 0 additions & 21 deletions .github/workflows/semver-unlabel.yaml

This file was deleted.

0 comments on commit 0d0b48f

Please sign in to comment.