Skip to content

Commit 895d3e6

Browse files
rubokamilchodola
authored andcommitted
Revise and fix workflows failures on release (#5142)
1 parent b9d3528 commit 895d3e6

File tree

9 files changed

+178
-183
lines changed

9 files changed

+178
-183
lines changed
Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
1-
name: '[RUN] CodeQL code analysis'
1+
name: 'CodeQL analysis'
22

33
on:
44
push:
5-
tags:
6-
- '*'
5+
tags: ['*']
6+
schedule:
7+
- cron: '0 0 * * 0'
8+
workflow_dispatch:
79

810
jobs:
9-
run-analysis:
10-
name: Analyse Nethermind code
11+
analyze:
12+
name: Analyze
1113
runs-on: ubuntu-latest
14+
permissions:
15+
actions: read
16+
contents: read
17+
security-events: write
1218
strategy:
1319
fail-fast: false
1420
matrix:
1521
language: ['csharp']
1622
steps:
1723
- name: Check out repository
1824
uses: actions/checkout@v3
19-
with:
20-
fetch-depth: 2
2125
- name: Update submodules
2226
run: git submodule update --init src/tests
2327
- name: Initialize CodeQL
24-
uses: github/codeql-action/init@v1
28+
uses: github/codeql-action/init@v2
2529
with:
2630
languages: ${{ matrix.language }}
2731
- name: Set up .NET
2832
uses: actions/setup-dotnet@v3
2933
with:
3034
dotnet-version: 7
3135
- name: Build Nethermind
32-
run: |
33-
cd src/Nethermind
34-
dotnet build Nethermind.sln -c release
35-
- name: Perform CodeQL Analysis
36-
uses: github/codeql-action/analyze@v1
36+
working-directory: src/Nethermind
37+
run: dotnet build Nethermind.sln -c release
38+
- name: Perform CodeQL analysis
39+
uses: github/codeql-action/analyze@v2
40+
with:
41+
category: '/language:${{ matrix.language }}'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'Discord release announcement'
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
announce:
9+
name: Announce on Discord
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Post announcement
13+
run: |
14+
read VERSION URL < <(echo $(curl -s 'https://api.github.com/repos/nethermindeth/nethermind/releases' | jq -r '.[0].name, .[0].html_url'))
15+
MESSAGE="@everyone **Nethermind ${VERSION} is out!**\n\n${URL}"
16+
curl ${{ secrets.DISCORD_WEBHOOK_URL }} -X POST --fail-with-body -H "Content-Type: application/json" \
17+
-d '{"username": "Nethermind", "content": "'"$MESSAGE"'"}'

.github/workflows/hive-tests.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: 'Hive tests'
2+
3+
on:
4+
push:
5+
tags: ['*']
6+
7+
workflow_dispatch:
8+
inputs:
9+
test-suite:
10+
description: 'Test suite'
11+
required: true
12+
default: 'ethereum/engine'
13+
type: choice
14+
options:
15+
- devp2p
16+
- ethereum/consensus
17+
- ethereum/engine
18+
- ethereum/graphql
19+
- ethereum/rpc
20+
- ethereum/rpc-compat
21+
- ethereum/sync
22+
limit:
23+
description: 'Limit'
24+
required: false
25+
type: string
26+
log-level:
27+
description: 'Log level'
28+
required: true
29+
default: '3'
30+
type: choice
31+
options: ['0', '1', '2', '3', '4', '5']
32+
hive-repo:
33+
description: 'Hive repo'
34+
required: true
35+
default: 'ethereum/hive'
36+
type: string
37+
hive-branch:
38+
description: 'Hive branch'
39+
default: 'master'
40+
required: false
41+
type: string
42+
43+
jobs:
44+
test:
45+
name: Build and run tests
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Set up parameters
49+
run: |
50+
echo "TEST_SUITE=${{ github.event.inputs.test-suite || 'ethereum/engine' }}" >> $GITHUB_ENV
51+
echo "LIMIT=${{ github.event.inputs.limit || '' }}" >> $GITHUB_ENV
52+
echo "LOG_LEVEL=${{ github.event.inputs.log-level || '3' }}" >> $GITHUB_ENV
53+
echo "HIVE_REPO=${{ github.event.inputs.hive-repo || 'ethereum/hive' }}" >> $GITHUB_ENV
54+
echo "HIVE_BRANCH=${{ github.event.inputs.hive-branch || 'master' }}" >> $GITHUB_ENV
55+
- name: Check out Nethermind repository
56+
uses: actions/checkout@v3
57+
with:
58+
path: nethermind
59+
- name: Set up QEMU
60+
uses: docker/setup-qemu-action@v2
61+
- name: Set up Docker Buildx
62+
uses: docker/setup-buildx-action@v2
63+
- name: Build Docker image
64+
uses: docker/build-push-action@v3
65+
with:
66+
context: nethermind
67+
file: nethermind/Dockerfile
68+
tags: nethermind:test-${{ github.sha }}
69+
outputs: type=docker,dest=/tmp/image.tar
70+
- name: Install Linux packages
71+
run: |
72+
sudo apt-get update
73+
sudo apt-get install libsnappy-dev libc6-dev libc6 build-essential
74+
- name: Set up Go environment
75+
uses: actions/[email protected]
76+
with:
77+
go-version: '>=1.17.0'
78+
- name: Check out Hive repository
79+
uses: actions/checkout@v3
80+
with:
81+
repository: ${{ env.HIVE_REPO }}
82+
ref: ${{ env.HIVE_BRANCH }}
83+
path: hive
84+
- name: Patch Hive Dockerfile
85+
run: sed -i 's#FROM nethermindeth/hive:$branch#FROM nethermind:test-${{ github.sha }}#g' hive/clients/nethermind/Dockerfile
86+
- name: Build Hive
87+
working-directory: hive
88+
run: go build .
89+
- name: Load Docker image
90+
run: docker load --input /tmp/image.tar
91+
- name: Run Hive
92+
if: env.LIMIT == ''
93+
continue-on-error: true
94+
working-directory: hive
95+
run: ./hive --client nethermind --sim $TEST_SUITE --sim.loglevel $LOG_LEVEL
96+
- name: Run Hive with limit
97+
if: env.LIMIT != ''
98+
continue-on-error: true
99+
working-directory: hive
100+
run: ./hive --client nethermind --sim $TEST_SUITE --sim.loglevel $LOG_LEVEL --sim.limit $LIMIT
101+
- name: Upload results
102+
uses: actions/upload-artifact@v3
103+
with:
104+
name: results-${{ github.run_number }}-${{ github.run_attempt }}
105+
path: hive/workspace
106+
retention-days: 7
107+
- name: Print results
108+
run: |
109+
chmod +x nethermind/scripts/hive-results.sh
110+
nethermind/scripts/hive-results.sh "hive/workspace/logs/*.json"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: '[RELEASE] Nethermind'
1+
name: 'Release'
22

33
on:
44
workflow_dispatch:

.github/workflows/run-discord-announcement.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/run-merge-hive-tests.yml

Lines changed: 0 additions & 113 deletions
This file was deleted.

build/debian/postinst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
#!/bin/bash
2+
23
arch=$(uname -m)
4+
35
if [[ $arch == x86_64* ]]; then
4-
curl -s https://api.github.com/repos/NethermindEth/nethermind/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep linux-amd64 | xargs wget -O nethermind.zip -q
5-
ln -s /usr/lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so > /dev/null 2>&1
6+
curl -s https://api.github.com/repos/NethermindEth/nethermind/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep linux-x64 | xargs wget -O nethermind.zip -q
7+
ln -s /usr/lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so > /dev/null 2>&1
68
elif [[ $arch == arm* ]] || [[ $arch = aarch64 ]]; then
7-
curl -s https://api.github.com/repos/NethermindEth/nethermind/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep linux-arm64 | xargs wget -O nethermind.zip -q
8-
ln -s /usr/lib/aarch64-linux-gnu/libdl.so.2 /usr/lib/aarch64-linux-gnu/libdl.so > /dev/null 2>&1
9-
apt update > /dev/null 2>&1 && apt install libgflags-dev -y > /dev/null 2>&1
9+
curl -s https://api.github.com/repos/NethermindEth/nethermind/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep linux-arm64 | xargs wget -O nethermind.zip -q
10+
ln -s /usr/lib/aarch64-linux-gnu/libdl.so.2 /usr/lib/aarch64-linux-gnu/libdl.so > /dev/null 2>&1
11+
apt update > /dev/null 2>&1 && apt install libgflags-dev -y > /dev/null 2>&1
1012
fi
13+
1114
unzip nethermind.zip -d nethermind
1215
rm -rf nethermind.zip
1316
mkdir -p /usr/share/nethermind
1417
cp -r nethermind/* /usr/share/nethermind
1518
rm -rf nethermind
19+
1620
wget https://raw.githubusercontent.com/NethermindEth/nethermind/master/scripts/execution.sh -O /usr/bin/nethermind
1721
chmod +x /usr/bin/nethermind

scripts/hive-results.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# SPDX-FileCopyrightText: 2023 Demerzel Solutions Limited
3+
# SPDX-License-Identifier: LGPL-3.0-only
4+
5+
for passed in "true" "false"
6+
do
7+
tmp=()
8+
mapfile tmp < <(jq '.testCases | map_values(select(.summaryResult.pass == $p)) | map(.name) | .[]' --argjson p "$passed" -r $1)
9+
IFS=$'\n' results=($(sort -f <<<"${tmp[*]}")); unset IFS
10+
11+
if ($passed == "true")
12+
then
13+
echo -e "\nPassed: ${#results[@]}\n"
14+
15+
for each in "${results[@]}"; do echo -e "\033[0;32m\u2714\033[0m $each"; done
16+
else
17+
echo -e "\nFailed: ${#results[@]}\n"
18+
19+
for each in "${results[@]}"; do echo -e "\033[0;31m\u2716\033[0m $each"; done
20+
21+
if [ ${#results[@]} -gt 0 ]; then exit 1; fi
22+
fi
23+
done

0 commit comments

Comments
 (0)