CI Job for Consensus specs (#8483)

Consensus Specification Tests takes less than 8 minutes so I think they
can be in a PR's own CI for whenever it is ready. for reference it is
less than make test
This commit is contained in:
Giulio rebuffo 2023-10-15 19:47:53 +02:00 committed by GitHub
parent bf2ef04c46
commit a7e63da066
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 103 additions and 8 deletions

View File

@ -0,0 +1,62 @@
name: Consensus specification tests
on:
push:
branches:
- devel
- alpha
- 'release/**'
pull_request:
branches:
- devel
- alpha
- 'release/**'
types:
- opened
- reopened
- synchronize
- ready_for_review
jobs:
tests:
strategy:
matrix:
os: [ ubuntu-20.04, macos-11 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential
- name: test-integration-caplin
run: cd cl/spectest && make tests && make mainnet
tests-windows:
strategy:
matrix:
os: [ windows-2022 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- uses: actions/cache@v3
with:
path: |
C:\ProgramData\chocolatey\lib\mingw
C:\ProgramData\chocolatey\lib\cmake
key: chocolatey-${{ matrix.os }}
- name: Install dependencies
run: |
choco upgrade mingw -y --no-progress --version 11.2.0.07112021
choco install cmake -y --no-progress --version 3.23.1
- name: test-integration-caplin
run: cd ./cl/spectest/ && .\wmake.ps1 Tests Mainnet

View File

@ -2,8 +2,8 @@
tests:
git clone https://github.com/ethereum/consensus-spec-tests
cd consensus-spec-tests && git checkout 70dc28b18c71f3ae080c02f51bd3421e0b60609b && git lfs pull && cd ..
GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/ethereum/consensus-spec-tests
cd consensus-spec-tests && git checkout 70dc28b18c71f3ae080c02f51bd3421e0b60609b && git lfs pull --exclude=tests/general,tests/minimal && cd ..
mv consensus-spec-tests/tests .
rm -rf consensus-spec-tests
rm -rf tests/minimal
@ -13,11 +13,7 @@ tests:
rm -rf tests/mainnet/deneb
clean:
rm -rf junit.xml
rm -rf test_report.html
rm -rf tests
mainnet:
go test -tags=spectest -run=/mainnet -failfast -v
run:
go test -v
CGO_CFLAGS=-D__BLST_PORTABLE__ go test -tags=spectest -run=/mainnet -failfast -v --timeout 30m

37
cl/spectest/wmake.ps1 Normal file
View File

@ -0,0 +1,37 @@
# Clean Function
function Clean {
Remove-Item -Recurse -Force -Path .\tests
}
# Tests Function
function Tests {
$env:GIT_LFS_SKIP_SMUDGE = "1"
$gitCloneCmd = "git clone https://github.com/ethereum/consensus-spec-tests"
$gitCheckoutCmd = "cd consensus-spec-tests; git checkout 70dc28b18c71f3ae080c02f51bd3421e0b60609b; git lfs pull --exclude=tests/general,tests/minimal; cd .."
Invoke-Expression $gitCloneCmd
Invoke-Expression $gitCheckoutCmd
Move-Item -Path ".\consensus-spec-tests\tests" -Destination ".\" -Force
Remove-Item -Path ".\consensus-spec-tests" -Recurse -Force
Remove-Item -Path ".\tests\minimal" -Recurse -Force
Remove-Item -Path ".\tests\mainnet\eip6110" -Recurse -Force
Remove-Item -Path ".\tests\mainnet\deneb" -Recurse -Force
}
# Mainnet Function
function Mainnet {
$env:CGO_CFLAGS = "-D__BLST_PORTABLE__"
go test -tags=spectest -run="/mainnet" -failfast -v
}
# Main Targets
if ($MyInvocation.BoundParameters["clean"]) {
Clean
}
elseif ($MyInvocation.BoundParameters["tests"]) {
Tests
} else {
Mainnet
}