Skip to content

Add taiko setup to sync chains workflow #11615

Add taiko setup to sync chains workflow

Add taiko setup to sync chains workflow #11615

name: Nethermind/Ethereum tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
inputs:
coverage:
default: false
description: Collect coverage
required: false
type: boolean
env:
COLLECT_COVERAGE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event.inputs.coverage }}
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1
RETENTION: 1
TERM: xterm
jobs:
nethermind-tests:
name: Run ${{ matrix.project }}
runs-on: ubuntu-latest
continue-on-error: true
outputs:
collect_coverage: ${{ env.COLLECT_COVERAGE }}
strategy:
matrix:
project:
- Nethermind.Abi.Test
- Nethermind.Api.Test
- Nethermind.AuRa.Test
- Nethermind.Blockchain.Test
- Nethermind.Cli.Test
- Nethermind.Clique.Test
- Nethermind.Config.Test
- Nethermind.Consensus.Test
- Nethermind.Core.Test
- Nethermind.Db.Test
- Nethermind.Ethash.Test
- Nethermind.EthStats.Test
- Nethermind.Evm.Test
- Nethermind.Facade.Test
- Nethermind.HealthChecks.Test
- Nethermind.Hive.Test
- Nethermind.JsonRpc.Test
- Nethermind.JsonRpc.TraceStore.Test
- Nethermind.KeyStore.Test
- Nethermind.Logging.NLog.Test
- Nethermind.Merge.AuRa.Test
- Nethermind.Merge.Plugin.Test
- Nethermind.Mining.Test
- Nethermind.Monitoring.Test
- Nethermind.Network.Discovery.Test
- Nethermind.Network.Dns.Test
- Nethermind.Network.Enr.Test
- Nethermind.Network.Test
- Nethermind.Optimism.Test
- Nethermind.Overseer.Test
- Nethermind.Runner.Test
- Nethermind.Serialization.Ssz.Test
- Nethermind.Shutter.Test
- Nethermind.Sockets.Test
- Nethermind.Specs.Test
- Nethermind.State.Test
- Nethermind.State.Test.Runner.Test
- Nethermind.Synchronization.Test
- Nethermind.Trie.Test
- Nethermind.TxPool.Test
- Nethermind.Wallet.Test
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
- name: Cache dotnet packages
id: cache-dotnet
uses: actions/cache/restore@v4
with:
path: ~/.nuget/packages/
key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}
- name: ${{ matrix.project }}
id: test
run: |
dotnet test src/Nethermind/${{ matrix.project }} -c release \
${{ env.COLLECT_COVERAGE == 'true' && '--collect:"XPlat Code Coverage"' || '' }}
- name: Save test outcome
if: success() || failure()
run: echo "${{ steps.test.outcome == 'success' }}," >> nethermind.outcome
- name: Upload test outcome
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-outcome
path: nethermind.outcome
retention-days: ${{ env.RETENTION }}
- name: Upload coverage report
if: env.COLLECT_COVERAGE == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-coverage
path: src/Nethermind/${{ matrix.project }}/TestResults/**/coverage.cobertura.xml
retention-days: ${{ env.RETENTION }}
nethermind-tests-status:
name: Nethermind tests
needs: nethermind-tests
runs-on: ubuntu-latest
steps:
- name: Download test outcomes
uses: actions/download-artifact@v4
- name: Ensure tests passed
run: |
data=$(cat **/nethermind.outcome) && data=${data%?}
passed=$(echo "[$data]" | jq -r 'all')
[ $passed = 'true' ] && exit 0 || exit 1
ethereum-tests:
name: Run ${{ matrix.project }}
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
project:
- Ethereum.Abi.Test
- Ethereum.Basic.Test
- Ethereum.Blockchain.Block.Legacy.Test
- Ethereum.Blockchain.Block.Test
- Ethereum.Blockchain.Legacy.Test
- Ethereum.Blockchain.Pyspec.Test
- Ethereum.Blockchain.Test
- Ethereum.Difficulty.Test
- Ethereum.HexPrefix.Test
- Ethereum.KeyAddress.Test
- Ethereum.PoW.Test
- Ethereum.Rlp.Test
- Ethereum.Transaction.Test
- Ethereum.Transition.Test
- Ethereum.Trie.Test
- Ethereum.VM.Test
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up .NET
uses: actions/setup-dotnet@v4
- name: ${{ matrix.project }}
id: test
run: |
dotnet test src/Nethermind/${{ matrix.project }} -c release \
${{ env.COLLECT_COVERAGE == 'true' && '--collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[Nethermind.Core.Test]*,[Nethermind.Blockchain.Test]*,[Ethereum.Test.Base]*' || '' }}
- name: Save test outcome
if: success() || failure()
run: echo "${{ steps.test.outcome == 'success' }}," >> ethereum.outcome
- name: Upload test outcome
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-outcome
path: ethereum.outcome
retention-days: ${{ env.RETENTION }}
- name: Upload coverage report
if: env.COLLECT_COVERAGE == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-coverage
path: src/Nethermind/${{ matrix.project }}/TestResults/**/coverage.cobertura.xml
retention-days: ${{ env.RETENTION }}
ethereum-tests-status:
name: Ethereum tests
needs: ethereum-tests
runs-on: ubuntu-latest
steps:
- name: Download test outcomes
uses: actions/download-artifact@v4
- name: Ensure tests passed
run: |
data=$(cat **/ethereum.outcome) && data=${data%?}
passed=$(echo "[$data]" | jq -r 'all')
[ $passed = 'true' ] && exit 0 || exit 1
codecov-upload:
name: Upload Codecov reports
needs: [nethermind-tests-status, ethereum-tests-status]
if: needs.nethermind-tests.outputs.collect_coverage == 'true'
runs-on: ubuntu-latest
steps:
- name: Download coverage reports
uses: actions/download-artifact@v4
with:
path: .coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-nethermind
directory: .coverage