-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix breaking detection changes (#99)
Fixes breaking changes in #96
- Loading branch information
Showing
1 changed file
with
14 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,16 +112,16 @@ jobs: | |
runs-on: ubuntu-latest | ||
outputs: | ||
# Expose matched filters as job 'packages' output variable | ||
go_package_changes: ${{ steps.filter_go.outputs.changes }} | ||
go_change_count: ${{ steps.length.outputs.GO_CHANGES_LENGTH }} | ||
packages: ${{ steps.filter_go.outputs.changes }} | ||
package_count: ${{ steps.length.outputs.FILTER_LENGTH }} | ||
solidity_changes: ${{ steps.filter_solidity.outputs.any_changed }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
|
||
# Check if any go files have been changed in each of the go packages | ||
# For pull requests it's not necessary to checkout the code | ||
- uses: dorny/paths-filter@v2 | ||
name: "Check for Go Changes" | ||
id: filter_go | ||
|
@@ -130,31 +130,30 @@ jobs: | |
core: 'core/**' | ||
tools: 'tools/**' | ||
ethergo: 'ethergo/**' | ||
# Check for solidity changes, if anything has been changed here we need to regenerate core | ||
- name: Check For Solidity Changes | ||
id: filter_solidity | ||
uses: tj-actions/[email protected] | ||
with: | ||
files: | | ||
**/*.sol | ||
- name: Run step if any of the listed files above change | ||
if: steps.filter_solidity.outputs.any_changed == 'true' | ||
run: | | ||
echo "One or more files listed above has changed." | ||
- id: Get go output changes length | ||
- id: length | ||
run: | | ||
# get length of go changes | ||
export GO_CHANGES_LENGTH=$(echo GO_FILTERED_PATHS | jq '. | length') | ||
echo "##[set-output name=GO_CHANGES_LENGTH;]$(echo GO_CHANGES_LENGTH)" | ||
export FILTER_LENGTH=$(echo $FILTERED_PATHS | jq '. | length') | ||
echo "##[set-output name=FILTER_LENGTH;]$(echo $FILTER_LENGTH)" | ||
env: | ||
GO_FILTERED_PATHS: ${{ steps.filter_go.outputs.changes }} | ||
|
||
FILTERED_PATHS: ${{ steps.filter_go.outputs.changes }} | ||
|
||
# make sure the build works | ||
build: | ||
name: Build | ||
needs: changes | ||
runs-on: ${{ matrix.platform }} | ||
if: ${{ needs.changes.outputs.go_change_count > 0 }} | ||
if: ${{ needs.changes.outputs.package_count > 0 }} | ||
strategy: | ||
matrix: | ||
go-version: | ||
|
@@ -195,12 +194,12 @@ jobs: | |
name: Lint | ||
runs-on: ubuntu-latest | ||
needs: changes | ||
if: ${{ needs.changes.outputs.go_change_count > 0 }} | ||
if: ${{ needs.changes.outputs.package_count > 0 }} | ||
strategy: | ||
matrix: | ||
# Parse JSON array containing names of all filters matching any of changed files | ||
# e.g. ['package1', 'package2'] if both package folders contains changes | ||
package: ${{ fromJSON(needs.changes.outputs.go_package_changes) }} | ||
package: ${{ fromJSON(needs.changes.outputs.packages) }} | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
|
@@ -325,7 +324,6 @@ jobs: | |
with: | ||
files: | | ||
*.go | ||
*.json | ||
- uses: jwalton/gh-find-current-pr@v1 | ||
id: find_pr | ||
|