Skip to content

Commit

Permalink
ci: refactor e2e workflows (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal authored Jan 20, 2025
1 parent e1b9595 commit 2402132
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 176 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build-cdk-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build CDK Image
on:
workflow_call:
inputs:
go-version:
required: true
type: string
docker-image-name:
required: true
type: string

jobs:
build-cdk-image:
runs-on: amd-runner-2204
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}

- name: Build CDK Docker Image
run: make build-docker

- name: Save CDK Image to Archive
run: docker save --output /tmp/${{ inputs.docker-image-name }}.tar ${{ inputs.docker-image-name }}

- name: Upload CDK Archive
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.docker-image-name }}
path: /tmp/${{ inputs.docker-image-name }}.tar
86 changes: 86 additions & 0 deletions .github/workflows/test-e2e-multi-chains.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Test E2E (multi chains)
on:
push:
branches:
- '**'
workflow_dispatch: {}

jobs:
build-cdk-image:
uses: ./.github/workflows/build-cdk-image.yml
with:
go-version: 1.22.x
docker-image-name: cdk

test-e2e:
needs: build-cdk-image
runs-on: amd-runner-2204
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
e2e-group:
- fork12-multi-pessimistic

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x

- name: Build Tools
run: make build-tools

- name: Checkout kurtosis-cdk
uses: actions/checkout@v4
with:
repository: 0xPolygon/kurtosis-cdk
path: kurtosis-cdk
ref: v0.2.27

- name: Install Kurtosis CDK tools
uses: ./kurtosis-cdk/.github/actions/setup-kurtosis-cdk

- name: Setup Bats and bats libs
uses: bats-core/[email protected]

- name: Download cdk archive
uses: actions/download-artifact@v4
with:
name: cdk
path: /tmp

- name: Load cdk image
run: |
docker load --input /tmp/cdk.tar
docker image ls -a
- name: Run E2E tests
run: make test-e2e-fork12-multi-pessimistic
working-directory: test
env:
KURTOSIS_FOLDER: ${{ github.workspace }}/kurtosis-cdk
BATS_LIB_PATH: /usr/lib/
AGGLAYER_PROVER_SP1_KEY: ${{ secrets.SP1_PRIVATE_KEY }}

- name: Dump enclave logs
if: failure()
run: kurtosis dump ./dump

- name: Generate archive name
if: failure()
run: |
archive_name="dump_run_with_args_${{matrix.e2e-group}}_${{ github.run_id }}"
echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV"
echo "Generated archive name: ${archive_name}"
kurtosis service exec cdk cdk-node-001 'cat /etc/cdk/cdk-node-config.toml' > ./dump/cdk-node-config.toml
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE_NAME }}
path: ./dump
78 changes: 78 additions & 0 deletions .github/workflows/test-e2e-single-chain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

name: Test E2E (single chain)
on:
push:
branches:
- '**'
workflow_dispatch: {}

jobs:
build-cdk-image:
uses: ./.github/workflows/build-cdk-image.yml
with:
go-version: 1.22.x
docker-image-name: cdk

test-e2e:
needs: build-cdk-image
runs-on: amd-runner-2204
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
e2e-group:
- fork12-pessimistic
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Checkout kurtosis-cdk
uses: actions/checkout@v4
with:
repository: 0xPolygon/kurtosis-cdk
path: kurtosis-cdk
ref: v0.2.27

- name: Install Kurtosis CDK tools
uses: ./kurtosis-cdk/.github/actions/setup-kurtosis-cdk

- name: Setup Bats and bats libs
uses: bats-core/[email protected]

- name: Download cdk archive
uses: actions/download-artifact@v4
with:
name: cdk
path: /tmp

- name: Load cdk image
run: |
docker load --input /tmp/cdk.tar
docker image ls -a
- name: Run E2E tests
run: make test-e2e-${{ matrix.e2e-group }}
working-directory: test
env:
KURTOSIS_FOLDER: ${{ github.workspace }}/kurtosis-cdk
BATS_LIB_PATH: /usr/lib/
AGGLAYER_PROVER_SP1_KEY: ${{ secrets.SP1_PRIVATE_KEY }}

- name: Dump enclave logs
if: failure()
run: kurtosis dump ./dump

- name: Generate archive name
if: failure()
run: |
archive_name="dump_run_with_args_${{matrix.e2e-group}}_${{ github.run_id }}"
echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV"
echo "Generated archive name: ${archive_name}"
kurtosis service exec cdk cdk-node-001 'cat /etc/cdk/cdk-node-config.toml' > ./dump/cdk-node-config.toml
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE_NAME }}
path: ./dump
175 changes: 0 additions & 175 deletions .github/workflows/test-e2e.yml

This file was deleted.

1 change: 0 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ var (
Usage: "Disable default configuration variables, all of them must be defined on config files",
Required: false,
}

allowDeprecatedFields = cli.BoolFlag{
Name: config.FlagAllowDeprecatedFields,
Usage: "Allow that config-files contains deprecated fields",
Expand Down

0 comments on commit 2402132

Please sign in to comment.