-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix-coderabbit-config
- Loading branch information
Showing
6 changed files
with
224 additions
and
210 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 |
---|---|---|
|
@@ -100,96 +100,3 @@ jobs: | |
if: always() | ||
shell: bash | ||
run: rm -rf * | ||
|
||
e2e-test: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 25 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# configure docker to use the containerd snapshotter | ||
# so that we can use the buildkit cache | ||
- uses: depot/use-containerd-snapshotter-action@v1 | ||
|
||
- name: Login to Docker Hub registry | ||
uses: docker/login-action@v2 | ||
if: (github.event_name == 'push' && github.repository == 'zeta-chain/node') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'zeta-chain/node') | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_READ_ONLY }} | ||
|
||
- name: Login to github docker registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Restore go cache | ||
uses: actions/cache@v4 | ||
id: restore-go-cache | ||
with: | ||
path: | | ||
go-cache | ||
key: cache-${{ hashFiles('go.sum') }} | ||
lookup-only: ${{ github.event_name != 'push' }} | ||
|
||
- name: Inject go cache into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-map: | | ||
{ | ||
"go-cache": "/root/.cache/go-build" | ||
} | ||
skip-extraction: ${{ steps.restore-go-cache.outputs.cache-hit || github.event_name != 'push' }} | ||
|
||
# build zetanode with cache options | ||
- name: Build zetanode for cache | ||
uses: docker/build-push-action@v6 | ||
env: | ||
CACHE_FROM_CONFIG: "type=registry,ref=ghcr.io/${{ github.repository }}:buildcache" | ||
CACHE_TO_CONFIG: "type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max" | ||
with: | ||
context: . | ||
file: ./Dockerfile-localnet | ||
push: false | ||
tags: zetanode:latest | ||
cache-from: ${{ env.CACHE_FROM_CONFIG }} | ||
cache-to: ${{ github.event_name == 'push' && env.CACHE_TO_CONFIG || '' }} | ||
target: latest-runtime | ||
|
||
- name: Start Test | ||
run: make start-e2e-test | ||
|
||
# use docker logs -f rather than docker attach to make sure we get the initial logs | ||
- name: Watch Test | ||
run: | | ||
container_id=$(docker ps --filter "ancestor=orchestrator:latest" --format "{{.ID}}") | ||
docker logs -f "${container_id}" & | ||
exit $(docker wait "${container_id}") | ||
- name: Full Log Dump On Failure | ||
if: failure() | ||
run: | | ||
make stop-localnet | ||
- name: Notify Slack on Failure | ||
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/develop' | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_CI_ALERTS }} | ||
|
||
- name: Stop Private Network | ||
if: always() | ||
run: | | ||
make stop-localnet | ||
- name: Clean Up Workspace | ||
if: always() | ||
shell: bash | ||
run: sudo rm -rf * | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: e2e | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
branches: | ||
- "*" | ||
merge_group: | ||
workflow_dispatch: | ||
schedule: | ||
# run at 6AM UTC Daily | ||
# 6AM UTC -> 11PM PT | ||
- cron: "0 6 * * *" | ||
|
||
concurrency: | ||
group: e2e-${{ github.head_ref || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
matrix-conditionals: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
outputs: | ||
UPGRADE_TESTS: ${{ steps.matrix-conditionals.outputs.UPGRADE_TESTS }} | ||
UPGRADE_LIGHT_TESTS: ${{ steps.matrix-conditionals.outputs.UPGRADE_LIGHT_TESTS }} | ||
ADMIN_TESTS: ${{ steps.matrix-conditionals.outputs.ADMIN_TESTS }} | ||
steps: | ||
# use cli rather than event context to avoid race conditions (label added after push) | ||
- id: matrix-conditionals | ||
run: | | ||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then | ||
labels=$(gh pr view -R ${{github.repository}} ${{github.event.pull_request.number}} --json labels -q '.labels[].name') | ||
if [[ "$labels" == *"UPGRADE_TESTS"* ]]; then | ||
echo "UPGRADE_TESTS=true" >> $GITHUB_OUTPUT | ||
fi | ||
if [[ "$labels" == *"UPGRADE_LIGHT_TESTS"* ]]; then | ||
echo "UPGRADE_LIGHT_TESTS=true" >> $GITHUB_OUTPUT | ||
fi | ||
if [[ "$labels" == *"ADMIN_TESTS"* ]]; then | ||
echo "ADMIN_TESTS=true" >> $GITHUB_OUTPUT | ||
fi | ||
elif [[ ${{ github.event_name }} == 'schedule' ]]; then | ||
echo "UPGRADE_TESTS=true" >> $GITHUB_OUTPUT | ||
echo "UPGRADE_LIGHT_TESTS=true" >> $GITHUB_OUTPUT | ||
echo "ADMIN_TESTS=true" >> $GITHUB_OUTPUT | ||
fi | ||
e2e: | ||
needs: matrix-conditionals | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- make-target: "start-e2e-test" | ||
runs-on: ubuntu-20.04 | ||
run: true | ||
- make-target: "start-upgrade-test" | ||
runs-on: ubuntu-20.04 | ||
run: ${{ needs.matrix-conditionals.outputs.UPGRADE_TESTS == 'true' }} | ||
- make-target: "start-upgrade-test-light" | ||
runs-on: ubuntu-20.04 | ||
run: ${{ needs.matrix-conditionals.outputs.UPGRADE_LIGHT_TESTS == 'true' }} | ||
- make-target: "start-e2e-admin-test" | ||
runs-on: ubuntu-20.04 | ||
run: ${{ needs.matrix-conditionals.outputs.ADMIN_TESTS == 'true' }} | ||
name: ${{ matrix.make-target }} | ||
uses: ./.github/workflows/reusable-e2e.yml | ||
with: | ||
make-target: ${{ matrix.make-target }} | ||
runs-on: ${{ matrix.runs-on}} | ||
run: ${{ matrix.run }} | ||
secrets: inherit | ||
# this allows you to set a required status check | ||
e2e-ok: | ||
runs-on: ubuntu-22.04 | ||
needs: e2e | ||
if: always() | ||
steps: | ||
- run: | | ||
result="${{ needs.e2e.result }}" | ||
if [[ $result == "success" || $result == "skipped" ]]; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi |
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
Oops, something went wrong.