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

fix breaking detection changes #99

Merged
merged 1 commit into from
Aug 15, 2022
Merged
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
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/changed-files@v26.1
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