Skip to content

Commit

Permalink
testing workflow dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sudeepdino008 committed Sep 25, 2024
1 parent 5b5eb0b commit e14fc98
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/ci-cd-main-branch-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
on:
push:
branches:
- 'main'
- 'kurtosis_fix2'
paths-ignore:
- '.github/**'
workflow_dispatch:
Expand Down Expand Up @@ -120,4 +120,16 @@ jobs:
echo The following docker images have been published:
echo "${{ env.DOCKERHUB_REPOSITORY }}:main-${{ steps.getCommitId.outputs.short_commit_id }}"
echo "${{ env.DOCKERHUB_REPOSITORY }}:main-latest"
## upload commit id for use in test-kurtosis-assertoor.yml
## reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#using-data-from-the-triggering-workflow
- name: Save commit id
run: |
mkdir -p ./COMMIT_ID_DOCKER_BUILD
echo "${{ steps.getCommitId.outputs.short_commit_id }}" >> ./COMMIT_ID_DOCKER_BUILD/commit
- uses: actions/upload-artifact@v4
with:
name: commit
path: COMMIT_ID_DOCKER_BUILD

32 changes: 30 additions & 2 deletions .github/workflows/test-kurtosis-assertoor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Kurtosis Assertoor GitHub Action
env:
DOCKERHUB_REPOSITORY: "erigontech/erigon"
APP_REPO: "erigontech/erigon"
CHECKOUT_REF: "main"
CHECKOUT_REF: "kurtosis_fix2"


on:
Expand Down Expand Up @@ -53,12 +53,40 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
run: exit 1

- name: 'Download Artifact'
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "commit"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/commit.zip`, Buffer.from(download.data));
- name: 'Extract commit id from triggering workflow artifact'
id: extractCommitId
run: |
unzip commit.zip
echo "commitId=$(cat commit)" >> "$GITHUB_OUTPUT
- name: Fast checkout git repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 ## 4.1.7 release
with:
repository: ${{ env.APP_REPO }}
fetch-depth: 1
ref: ${{ env.CHECKOUT_REF }}
ref: ${{ steps.extractCommitId.outputs.commitId }}
path: 'erigon'

- name: Setup go env and cache
Expand Down

0 comments on commit e14fc98

Please sign in to comment.