-
Notifications
You must be signed in to change notification settings - Fork 2
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
Devnet-Add test pipeline #140
Open
naveen-consensys
wants to merge
2
commits into
main
Choose a base branch
from
add-test-pipeline-for-devnet
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,134 @@ | ||
name: test-linea-devnet | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
workflow_call: | ||
outputs: | ||
workflow_run_id: | ||
description: "the run id of the workflow" | ||
value: ${{ jobs.build.outputs.workflow_run_id }} | ||
workflow_dispatch: | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: dockerhub | ||
outputs: | ||
workflow_run_id: ${{ steps.assemble.outputs.workflow_id }} | ||
dockertag: ${{ steps.assemble.outputs.dockertag }} | ||
dockerimage: ${{ steps.assemble.outputs.dockerimage }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: build the linea devnet artifacts | ||
id: assemble | ||
uses: ./.github/actions/assemble-devnet | ||
|
||
- name: set up docker buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
driver: docker | ||
|
||
- name: login to docker | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USER_RW }} | ||
password: ${{ secrets.DOCKER_PASSWORD_RW }} | ||
|
||
- name: set docker build args | ||
run: | | ||
echo "Building docker tag: ${{ steps.assemble.outputs.dockertag }}" | ||
echo "Building docker image: ${{ steps.assemble.outputs.dockerimage }}" | ||
|
||
- name: build the image | ||
uses: docker/build-push-action@v6 | ||
env: | ||
DOCKER_BUILD_SUMMARY: false | ||
with: | ||
context: linea-besu/. | ||
platforms: linux/amd64 | ||
provenance: false | ||
build-args: | | ||
VERSION=${{ steps.assemble.outputs.dockertag }} | ||
VCS_REF=${{ github.sha }} | ||
BUILD_DATE=${{ steps.assemble.outputs.build_date }} | ||
tags: | | ||
consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }} | ||
|
||
- name: Save Docker image | ||
id: dockersave | ||
run: | | ||
docker images | ||
docker save consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }} -o /tmp/docker-image-devnet.tar | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docker-image-devnet | ||
path: /tmp/docker-image-devnet.tar | ||
retention-days: 1 | ||
|
||
prepare_tests: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
outputs: | ||
files: ${{ steps.list.outputs.files }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Split profiles | ||
id: list | ||
run: | | ||
files=$(ls linea-besu/profiles/*devnet* | xargs -n 1 basename | sed 's/\.[^.]*$//') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But we don't have devnet profile |
||
files_json=$(echo "$files" | tr ' ' '\n' | jq -R -s -c 'split("\n") | map(select(length > 0))') | ||
echo "files=$files_json" >> "$GITHUB_OUTPUT" | ||
echo "Files: $files_json" | ||
|
||
test-profile: | ||
timeout-minutes: 4 | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
needs: [prepare_tests, build] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
file: ${{ fromJSON(needs.prepare_tests.outputs.files) }} | ||
env: | ||
CONTAINER_NAME: linea-besu-profile-check-${{ matrix.file }} | ||
DOCKER_IMAGE: ${{needs.build.outputs.dockerimage}} | ||
steps: | ||
- name: Check repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: docker-image-devnet | ||
path: /tmp | ||
|
||
- name: Load image | ||
run: | | ||
docker load --input /tmp/docker-image-devnet.tar | ||
|
||
- name: Start container | ||
run: | | ||
env | ||
COMMAND="docker run -d --name ${{ env.CONTAINER_NAME }} -e BESU_PROFILE=${{ matrix.file }} ${{ env.DOCKER_IMAGE }}" | ||
echo $COMMAND | ||
eval $COMMAND | ||
|
||
- name: Verify besu container | ||
run: bash .github/workflows/BesuContainerVerify.sh | ||
env: | ||
CONTAINER_NAME: ${{ env.CONTAINER_NAME }} | ||
|
||
- name: Stop container | ||
run: docker stop ${{ env.CONTAINER_NAME }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to upload it though? Can't we just continue on with the testing in the same job? We're not reusing steps across workloads anyway