Skip to content

Commit

Permalink
merge from main (#312)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Shawn <[email protected]>
Co-authored-by: Mikhail Wall <[email protected]>
Co-authored-by: aloknerurkar <[email protected]>
Co-authored-by: mrekucci <[email protected]>
Co-authored-by: Kartik Chopra <[email protected]>
  • Loading branch information
6 people authored Aug 4, 2024
1 parent b7b3b9d commit b1f6b11
Show file tree
Hide file tree
Showing 151 changed files with 9,890 additions and 7,070 deletions.
36 changes: 11 additions & 25 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ jobs:
- name: Upload Artifact to AWS S3
run: |
aws s3 cp ${{ env.ARTIFACT_NAME }} s3://${{ secrets.AWS_S3_BUCKET }}
- name: Set Artifact Retention
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
aws s3api put-object-tagging \
--bucket ${{ secrets.AWS_S3_BUCKET }} \
--key "${{ env.ARTIFACT_NAME }}" \
Expand All @@ -56,10 +52,6 @@ jobs:
module: [ external/geth ]

steps:
- name: Set Snapshot Flag
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: echo "FLAGS=--snapshot" >> ${GITHUB_ENV}

- name: Checkout Code
uses: actions/checkout@v4
with:
Expand All @@ -86,7 +78,7 @@ jobs:
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --config=./${{ matrix.module }}/.goreleaser.yml --clean ${{ env.FLAGS }}
args: release --config=./${{ matrix.module }}/.goreleaser.yml --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -99,19 +91,13 @@ jobs:

- name: Upload Artifacts to AWS S3
run: |
aws s3 cp ./dist/ s3://${{ secrets.AWS_S3_BUCKET }} \
--recursive \
--exclude "*" \
--include "*.gz" \
--include "*.txt" \
- name: Set Artifacts Retention
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
ls -1 ./dist | grep '\.gz\|\.txt$' | while read -r file; do
echo "Tagging uploaded file $file for auto delete"
aws s3api put-object-tagging \
--bucket ${{ secrets.AWS_S3_BUCKET }} \
--key "$file" \
--tagging 'TagSet=[{Key=AutoDelete,Value=true}]'
done
find /tmp/dist -type f \( -name "*.gz" -o -name "*.txt" \) \
-exec sh -c '
file=$(basename "${1}")
echo "Uploading ${file} to S3..."
aws s3 cp "${1}" s3://${{ secrets.AWS_S3_BUCKET }}/ &&
aws s3api put-object-tagging \
--bucket ${{ secrets.AWS_S3_BUCKET }} \
--key "${file}" \
--tagging "TagSet=[{Key=AutoDelete,Value=true}]"
' _ {} \;
40 changes: 28 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,35 +81,51 @@ jobs:
check-latest: true
cache-dependency-path: go.work.sum

- name: Determine Workspace Modules
- name: Determine Modules
run: |
echo $(go list -f '{{.Dir}}' -m)
echo "GO_LINT_DIRS=$(go list -f '{{.Dir}}/...' -m | grep -v '/external/geth' | tr '\n' ' ')" >> ${GITHUB_ENV}
WORKSPACE_MODULES=$(go list -f '{{.Dir}}' -m)
ADDITIONAL_MODULES=(
"${GITHUB_WORKSPACE}/external/geth"
)
ALL_MODULES=$(printf "%s\n" "${WORKSPACE_MODULES}" "${ADDITIONAL_MODULES[@]}")
echo "GO_MODULES<<EOF" >> ${GITHUB_ENV}
echo "${ALL_MODULES}" >> ${GITHUB_ENV}
echo "EOF" >> ${GITHUB_ENV}
echo "GO_LINT_MODULES=$(printf "%s " $(echo "${ALL_MODULES}" | sed 's|$|/...|' | grep -v '/external/geth'))" >> ${GITHUB_ENV}
- name: Run Gofmt
run: go list -f '{{.Dir}}' -m | xargs gofmt -d -e -l
run: |
GOFMT_OUTPUT=$(echo ${GO_MODULES} | tr ' ' '\n' | xargs gofmt -d -e -l)
if [ -n "${GOFMT_OUTPUT}" ]; then
echo "The following files are not formatted correctly:"
echo "${GOFMT_OUTPUT}"
exit 1
fi
- name: Run Tidy & Workspace Sync
run: |
go list -f '{{.Dir}}' -m | xargs -L1 go mod tidy -C
echo ${GO_MODULES} | tr ' ' '\n' | xargs -L1 go mod tidy -C
go work sync
git checkout ${{ github.event.pull_request.head.ref }}
git diff --name-only --exit-code . || (echo "Golang modules/workspace not in sync with go.mod/go.sum/go.work/go.work.sum files" && exit 1)
git reset --hard HEAD
- name: Run Lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: v1.57.2
args: --timeout 15m --verbose ${{ env.GO_LINT_DIRS }}
skip-cache: true # TODO(mrekucci): remove when the following issue is solved https://github.com/golangci/golangci-lint-action/issues/135#issuecomment-2039548548
version: v1.59
args: --timeout 15m --verbose ${{ env.GO_LINT_MODULES }}

- name: Run Build
run: go list -f '{{.Dir}}/...' -m | xargs go build
run: echo ${GO_MODULES} | tr ' ' '\n' | xargs -I {} sh -c 'go build -C {} -v ./...'
env:
GOWORK: off

# TODO(mrekucci): Re-enable /external/geth module when tests are passing.
- name: Run Test
run: go list -f '{{.Dir}}/...' -m | grep -v '/external/geth' | xargs go test -short -race
run: echo ${GO_MODULES} | tr ' ' '\n' | grep -v '/external/geth' | xargs -I {} sh -c 'go test -short -race {}/...'

- name: Setup Protobuf
uses: bufbuild/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- devnet
- testnet
- stressnet
- manual-test
default: 'devnet'
all_targets:
description: 'All Arch & Os Targets'
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ jobs:
check-latest: true
cache-dependency-path: go.work.sum

# TODO(mrekucci): Re-enable when the repo is finalized.
# - name: GHCR Docker Login
# run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin
# - name: Setup Docker Buildx
# uses: docker/setup-buildx-action@v3

- name: Release
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
38 changes: 0 additions & 38 deletions bridge/hyperlane/Makefile

This file was deleted.

114 changes: 0 additions & 114 deletions bridge/hyperlane/README.md

This file was deleted.

Loading

0 comments on commit b1f6b11

Please sign in to comment.