Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-and-test:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
dotnet-version: ['9.0.x']
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test with dotnet
run: dotnet test --no-restore --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"

- name: Upload dotnet test results
uses: actions/upload-artifact@v4
with:
name: dotnet-results--${{ matrix.os }}
path: TestResults--${{ matrix.os }}
if: ${{ always() }}

lint:
name: Lint/Format Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'

- name: Restore dependencies
run: dotnet restore

- name: Check formatting
run: dotnet format --verify-no-changes --verbosity diagnostic

security:
name: Security Scan
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'

- name: Restore dependencies
run: dotnet restore

- name: Checking for external vulnerabilites
run: |
dotnet list package --vulnerable --include-transitive 2>&1 | tee vuln.log
echo "Analyze dotnet list package..."
! grep -q -i "has the following vulnerable packages" vuln.log
36 changes: 36 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PR Validation

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
validate:
name: Validate PR
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Debug --no-restore

- name: Check for compilation warnings
run: dotnet build --configuration Release --no-restore --warnaserror

- name: Run tests
run: dotnet test --configuration Release --no-build --verbosity normal

- name: Check formatting
run: dotnet format style --no-restore --verify-no-changes
2 changes: 1 addition & 1 deletion src/BitcoinKernel.Interop/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public static extern int ScriptPubkeyVerify(
IntPtr script_pubkey,
long amount,
IntPtr tx_to,
IntPtr[] spent_outputs,
IntPtr[]? spent_outputs,
nuint spent_outputs_len,
uint input_index,
uint flags,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageReference Include="coverlet.collector" Version="6.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions tests/BitcoinKernel.Tests/BitcoinKernel.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageReference Include="coverlet.collector" Version="6.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading