-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (116 loc) · 3.84 KB
/
test-linea-sepolia.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
name: test-linea-sepolia
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 sepolia artifacts
id: assemble
uses: ./.github/actions/assemble-sepolia
- 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-sepolia.tar
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docker-image-sepolia
path: /tmp/docker-image-sepolia.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/*sepolia* | xargs -n 1 basename | sed 's/\.[^.]*$//')
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-sepolia
path: /tmp
- name: Load image
run: |
docker load --input /tmp/docker-image-sepolia.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 }}