Skip to content

Commit 7fb9b2d

Browse files
refactor(ci): Split CI into separate workflows and upgrade to .NET 10 (#635)
ci: Refactor CI into separate workflows and add Codecov - Split monolithic ci.yml into focused workflows: - build.yml: Build verification (.NET 10) - format.yml: Code format check (.NET 10) - test.yml: Tests with Codecov coverage (.NET 10) - scorecard.yml: OpenSSF Scorecard (pinned SHA) - Add codecov.yml configuration for coverage reporting - Keep legacy ci.yml (deprecated) for existing PRs - Update README with CI, Codecov, and Scorecard badges
1 parent 37b367c commit 7fb9b2d

7 files changed

Lines changed: 211 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Build verification workflow
2+
name: Build
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
project:
21+
- src/Nethermind.Arbitrum/Nethermind.Arbitrum.csproj
22+
- src/Nethermind.Arbitrum.Test/Nethermind.Arbitrum.Test.csproj
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
submodules: true
29+
30+
- name: Setup .NET
31+
uses: actions/setup-dotnet@v4
32+
with:
33+
dotnet-version: '10.0.x'
34+
35+
- name: Restore dependencies
36+
run: dotnet restore ${{ matrix.project }}
37+
38+
- name: Build
39+
run: dotnet build ${{ matrix.project }} --configuration Release --no-restore

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# DEPRECATED: This workflow is kept for backward compatibility with existing PRs
2+
# New PRs should use the separate workflows: build.yml, format.yml, test.yml
3+
# TODO: Remove after all open PRs are updated
4+
15
name: Nethermind.Arbitrum CI & Coverage
26

37
on:
@@ -31,7 +35,7 @@ jobs:
3135
- name: Setup .NET
3236
uses: actions/setup-dotnet@v4
3337
with:
34-
dotnet-version: '9.0.x'
38+
dotnet-version: '10.0.x'
3539

3640
- name: Build ${{ matrix.project }}
3741
run: dotnet build ${{ matrix.project }} --configuration Release
@@ -51,7 +55,7 @@ jobs:
5155
- name: Setup .NET
5256
uses: actions/setup-dotnet@v4
5357
with:
54-
dotnet-version: '9.0.x'
58+
dotnet-version: '10.0.x'
5559

5660
- name: Install dotnet-format
5761
run: dotnet tool install -g dotnet-format
@@ -72,7 +76,7 @@ jobs:
7276
- name: Setup .NET
7377
uses: actions/setup-dotnet@v4
7478
with:
75-
dotnet-version: '9.0.x'
79+
dotnet-version: '10.0.x'
7680

7781
- name: Run tests with Arbitrum-only coverage (Cobertura)
7882
run: |

.github/workflows/format.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Code format verification workflow
2+
name: Format Check
3+
4+
on:
5+
push:
6+
branches: [main, develop]
7+
pull_request:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
format:
15+
name: Format Check
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
project:
21+
- src/Nethermind.Arbitrum/Nethermind.Arbitrum.csproj
22+
- src/Nethermind.Arbitrum.Test/Nethermind.Arbitrum.Test.csproj
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
submodules: true
29+
30+
- name: Setup .NET
31+
uses: actions/setup-dotnet@v4
32+
with:
33+
dotnet-version: '10.0.x'
34+
35+
- name: Check code format
36+
run: dotnet format ${{ matrix.project }} --verify-no-changes

.github/workflows/scorecard.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: OpenSSF Scorecard
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions: read-all
9+
10+
jobs:
11+
analysis:
12+
name: Scorecard Analysis
13+
runs-on: ubuntu-latest
14+
permissions:
15+
# Needed for Code Scanning upload
16+
security-events: write
17+
# Needed for OIDC token generation for scorecard
18+
id-token: write
19+
# Needed for repo checkout
20+
contents: read
21+
# Needed for Dependency Submission API
22+
actions: read
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
persist-credentials: false
29+
30+
- name: Run Scorecard Analysis
31+
uses: ossf/scorecard-action@ff5dd8929f96a8a4dc67d13f32b8c75057829621 # v2.4.0
32+
with:
33+
results_file: results.sarif
34+
results_format: sarif
35+
# Publish results to OpenSSF REST API for public visibility
36+
publish_results: true
37+
38+
- name: Upload Scorecard Results to GitHub Security Tab
39+
uses: github/codeql-action/upload-sarif@v3
40+
with:
41+
sarif_file: results.sarif
42+
43+
- name: Upload Scorecard Results as Artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: scorecard-results
47+
path: results.sarif
48+
retention-days: 7

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Test and coverage workflow
2+
# Uses XPlat Code Coverage (built-in) + Codecov for reporting
3+
name: Test
4+
5+
on:
6+
push:
7+
branches: [main, develop]
8+
pull_request:
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
test:
16+
name: Test
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: true
24+
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: '10.0.x'
29+
30+
- name: Test with coverage
31+
run: >
32+
dotnet test src/Nethermind.Arbitrum.Test/Nethermind.Arbitrum.Test.csproj
33+
--configuration Release
34+
--collect:"XPlat Code Coverage"
35+
--results-directory ./coverage
36+
--
37+
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura
38+
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Include=[Nethermind.Arbitrum*]*
39+
40+
- name: Upload to Codecov
41+
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
42+
with:
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
directory: ./coverage
45+
fail_ci_if_error: false

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
# Nethermind Arbitrum Plugin
1010

11+
[![Build](https://github.com/NethermindEth/nethermind-arbitrum/actions/workflows/build.yml/badge.svg)](https://github.com/NethermindEth/nethermind-arbitrum/actions/workflows/build.yml)
12+
[![Format Check](https://github.com/NethermindEth/nethermind-arbitrum/actions/workflows/format.yml/badge.svg)](https://github.com/NethermindEth/nethermind-arbitrum/actions/workflows/format.yml)
13+
[![Test](https://github.com/NethermindEth/nethermind-arbitrum/actions/workflows/test.yml/badge.svg)](https://github.com/NethermindEth/nethermind-arbitrum/actions/workflows/test.yml)
14+
[![OpenSSF Scorecard](https://github.com/NethermindEth/nethermind-arbitrum/actions/workflows/scorecard.yml/badge.svg)](https://github.com/NethermindEth/nethermind-arbitrum/actions/workflows/scorecard.yml)
15+
[![codecov](https://codecov.io/gh/NethermindEth/nethermind-arbitrum/branch/main/graph/badge.svg)](https://codecov.io/gh/NethermindEth/nethermind-arbitrum)
1116
[![License: BSL-1.1](https://img.shields.io/badge/License-BSL%201.1-blue.svg)](LICENSE.md)
1217

1318
Nethermind Arbitrum Plugin enables execution layer functionality for Arbitrum rollups, providing client diversity for the Arbitrum ecosystem.

codecov.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Codecov configuration for nethermind-arbitrum
2+
# https://docs.codecov.io/docs/codecovyml-reference
3+
4+
coverage:
5+
status:
6+
project:
7+
default:
8+
target: 60%
9+
threshold: 2%
10+
if_ci_failed: error
11+
patch:
12+
default:
13+
target: 60%
14+
threshold: 2%
15+
if_ci_failed: error
16+
17+
comment:
18+
layout: "header,diff,flags,files"
19+
behavior: default
20+
require_changes: false
21+
require_base: false
22+
23+
# Ignore non-production code
24+
ignore:
25+
- "src/Nethermind/**" # Nethermind submodule (not our code)
26+
- "**/*.Test/**" # Test projects
27+
- "**/bin/**"
28+
- "**/obj/**"
29+
- "**/*.Designer.cs"
30+
- "**/*.generated.cs"
31+
- "**/Migrations/**"

0 commit comments

Comments
 (0)