Skip to content

Commit

Permalink
fix breaking detection changes (#99)
Browse files Browse the repository at this point in the history
Fixes breaking changes in #96
  • Loading branch information
trajan0x authored Aug 15, 2022
1 parent c2fe62b commit 5cce21a
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -325,7 +324,6 @@ jobs:
with:
files: |
*.go
*.json
- uses: jwalton/gh-find-current-pr@v1
id: find_pr
Expand Down

0 comments on commit 5cce21a

Please sign in to comment.