-
Notifications
You must be signed in to change notification settings - Fork 91
142 lines (121 loc) · 4.12 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
# A copy/paste of the cdk node e2e tests with small changes to make in work in the kurtosis-cdk repository.
# https://github.com/0xPolygon/cdk/blob/main/.github/workflows/test-e2e.yml
name: Test
on:
pull_request:
push:
branches: [main]
concurrency:
group: test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
POLYCLI_VERSION: v0.1.65 # 2024-12-16
CDK_VERSION: v0.5.0-beta10 # 2024-12-10
jobs:
build-cdk-image:
if: false
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Checkout cdk repository
uses: actions/checkout@v4
with:
repository: 0xPolygon/cdk
path: cdk
ref: ${{ env.CDK_VERSION }}
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
cache-dependency-path: cdk/go.sum
- name: Build cdk docker image
working-directory: cdk
run: make build-docker
- name: Save cdk image to archive
run: docker save --output /tmp/cdk.tar cdk
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: cdk
path: /tmp/cdk.tar
cdk-e2e-tests:
if: false
runs-on: ubuntu-latest
timeout-minutes: 45
needs: build-cdk-image
strategy:
fail-fast: false
matrix:
e2e-group:
- "fork9-validium"
- "fork11-rollup"
- "fork12-validium"
- "fork12-rollup"
- "fork12-pessimistic"
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# This step will only execute if the necessary secrets are available, preventing failures
# on pull requests from forked repositories.
if: ${{ env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Install Kurtosis CDK tools
uses: ./.github/actions/setup-kurtosis-cdk
- name: Install polycli
run: |
tmp_dir=$(mktemp -d)
curl -L "https://github.com/0xPolygon/polygon-cli/releases/download/${{ env.POLYCLI_VERSION }}/polycli_${{ env.POLYCLI_VERSION }}_linux_amd64.tar.gz" | tar -xz -C "$tmp_dir"
mv "$tmp_dir"/* /usr/local/bin/polycli
rm -rf "$tmp_dir"
sudo chmod +x /usr/local/bin/polycli
/usr/local/bin/polycli version
- name: Checkout cdk repository
uses: actions/checkout@v4
with:
repository: 0xPolygon/cdk
path: cdk
ref: ${{ env.CDK_VERSION }}
- name: Setup bats
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
working-directory: cdk/test
run: make test-e2e-${{ matrix.e2e-group }}
# Some of the test environments, the pessimistic envs, require the SP1 private key.
# This check makes sure that such environments will be tested only if the necessary secrets
# are available, preventing failures on pull requests from forked repositories.
if: ${{ !contains(matrix.e2e-group, 'pessimistic') || (contains(matrix.e2e-group, 'pessimistic') && env.agglayer_prover_sp1_key) }}
env:
KURTOSIS_FOLDER: ${{ github.workspace }}
BATS_LIB_PATH: /usr/lib/
agglayer_prover_sp1_key: ${{ secrets.SP1_PRIVATE_KEY }}
- name: Dump enclave
if: failure()
run: kurtosis enclave dump cdk ./dump
- name: Generate archive name
if: failure()
run: |
archive_name="dump_cdk_e2e_test_${{matrix.e2e-group}}_${{ github.run_id }}"
echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV"
echo "Generated archive name: ${archive_name}"
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE_NAME }}
path: ./dump