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

CI bug for main/release #211

Merged
merged 9 commits into from
Jul 17, 2023
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
45 changes: 23 additions & 22 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: steward-steward
PR_NUMBER: ${{ github.event.number }}
HARDHAT_IMAGE: ghcr.io/peggyjv/steward-hardhat
HARDHAT_IMAGE_NAME: steward-hardhat
ORCHESTRATOR_IMAGE_NAME: ghcr.io/peggyjv/gravity-bridge-orchestrator:main
SOMMELIER_IMAGE: ghcr.io/peggyjv/sommelier-sommelier:main
Expand Down Expand Up @@ -41,20 +39,14 @@ jobs:
key: ${{ runner.os }}-multi-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-multi-buildx
- name: container-login
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: labels
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.HARDHAT_IMAGE }}
images: ${{ env.HARDHAT_IMAGE_NAME }}
- name: Make upload dir
run: mkdir -p ${{ env.UPLOAD_DIR }}
- name: build-and-push
- name: build
uses: docker/build-push-action@v2
with:
context: integration_tests/ethereum
Expand Down Expand Up @@ -95,14 +87,19 @@ jobs:
key: ${{ runner.os }}-multi-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-multi-buildx
- name: labels
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.IMAGE_NAME }}
- name: Make upload dir
run: mkdir -p ${{ env.UPLOAD_DIR }}
- name: build-and-push
- name: build
uses: docker/build-push-action@v2
with:
file: Dockerfile
push: false
tags: steward:prebuilt
push: ${{ github.event_name != 'pull_request' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose my main question here is: do we need to push to Docker at all for steward and hardhat images in our CI workflows? Couldn't we just build the steward and hardhat docker images as artifacts and remove the push aspect entirely?

Copy link
Member Author

@cbrit cbrit Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my thinking was we wanted the steward:main tag to get pushed when merging to main?

afa hardhat, maybe not so much

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really need to publish any docker images unless something else needs to pull them. Steward as a repo is effectively a leaf node in the dependency tree.

tags: ${{ steps.meta.outputs.tags }}
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
Expand Down Expand Up @@ -145,17 +142,21 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: container-login
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: docker sommelier metadata
id: meta-sommelier
uses: docker/metadata-action@v3
with:
images: ${{ env.SOMMELIER_IMAGE }}
- name: docker hardhat metadata
id: meta-hardhat
uses: docker/metadata-action@v3
with:
images: ${{ env.HARDHAT_IMAGE_NAME }}
- name: docker steward metadata
id: meta-steward
uses: docker/metadata-action@v3
with:
images: ${{ env.IMAGE_NAME }}
- name: pull sommelier image
run: docker pull ${{ env.SOMMELIER_IMAGE }}
- name: rename sommelier image
Expand All @@ -171,19 +172,19 @@ jobs:
with:
name: ${{ env.HARDHAT_IMAGE_NAME }}
path: ${{ env.DOWNLOAD_DIR }}/
# The image is already tagged at this point by the hardhat-build job
- name: Load hardhat image
run: docker load --input ${{ env.DOWNLOAD_DIR }}/${{ env.HARDHAT_ARTIFACT }}
- name: Rename hardhat image
run: docker tag ${{ env.HARDHAT_IMAGE }}:pr-${{ env.PR_NUMBER }} ethereum:prebuilt
run: docker tag ${{ steps.meta-hardhat.outputs.tags }} ethereum:prebuilt
- name: Get steward artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.IMAGE_NAME }}
path: ${{ env.DOWNLOAD_DIR }}/
# The image is already tagged at this point by the steward-build job
- name: Load steward image
run: docker load --input ${{ env.DOWNLOAD_DIR }}/${{ env.STEWARD_ARTIFACT }}
- name: Rename steward image
run: docker tag ${{ steps.meta-steward.outputs.tags }} steward:prebuilt
- name: clean the slate
run: make e2e_clean_slate
- name: build go test binary
Expand Down