Skip to content

Commit

Permalink
Merge pull request #28 check breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rekby authored Mar 1, 2023
2 parents b6206c2 + c1bbb5b commit 08bddb5
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/breaking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This script based on github.com/bool64/dev.

name: check-api-changes
on:
- pull_request
- push

jobs:
gorelease:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: "stable"

- name: Checkout code
uses: actions/checkout@v3

- name: Install gorelease
run: go install golang.org/x/exp/cmd/gorelease@latest

- name: Install egrep
run: which egrep || apt install egrep

- name: Check API changes
id: gorelease
run: |
OUTPUT=$(gorelease -base=latest || true);
OUTPUT=$(echo "$OUTPUT" | egrep -v "^.*from .*\/internal\/.* to .*\/internal\/.*$");
OUTPUT="${OUTPUT//'%'/'%25'}"
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
echo "::set-output name=report::$OUTPUT";
- name: Comment Report
if: always()
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
header: gorelease
message: |
### API Changes
${{ steps.gorelease.outputs.report }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.idea/
4 changes: 2 additions & 2 deletions interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ const (

// ScopePackage mean fixture function with same parameters called once per package
// for use the scope with TearDown function developer must initialize global handler and cleaner at TestMain.
ScopePackage CacheScope = iota
ScopePackage

// ScopeTestAndSubtests mean fixture cached for top level test and subtests
ScopeTestAndSubtests CacheScope = iota
ScopeTestAndSubtests
)

// FixtureCallbackFunc - function, which result can cached
Expand Down

0 comments on commit 08bddb5

Please sign in to comment.