ci: run tests, fuzz smoke and docs checks on GitHub Actions
Offline test suite on Ubuntu and Windows, a random-input fuzz smoke per parser target, and docs/check-docs.sh on every push to main and PR.
This commit is contained in:
1 parent
aec68ea047
commit
928cb31cdf
1 file changed
+87
@@ -0,0 +1,87 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
# Cancel superseded runs of the same branch/PR.
|
||||
concurrency:
|
||||
group: ci-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
DOTNET_NOLOGO: true
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test (${{ matrix.os }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 20
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
|
||||
# Build/test only the test project and what it references (Core, Fuzz, ServerProbe):
|
||||
# the Android head needs a workload and SDK that CI does not provision.
|
||||
- name: Restore
|
||||
run: dotnet restore tests/PalladiumWallet.Tests
|
||||
|
||||
- name: Build
|
||||
run: dotnet build tests/PalladiumWallet.Tests --no-restore -c Release
|
||||
|
||||
# Offline and deterministic: unit, property-based (CsCheck), fuzz-corpus replay and the
|
||||
# in-process FakeElectrumServer tests. LiveServerTests is a no-op without
|
||||
# PALLADIUM_TEST_SERVERS, so no third-party server is contacted.
|
||||
- name: Test
|
||||
run: >
|
||||
dotnet test tests/PalladiumWallet.Tests --no-build -c Release
|
||||
--logger "trx;LogFileName=test-results.trx"
|
||||
--collect:"XPlat Code Coverage"
|
||||
--results-directory TestResults
|
||||
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-results-${{ matrix.os }}
|
||||
path: TestResults
|
||||
retention-days: 14
|
||||
|
||||
fuzz-smoke:
|
||||
name: Fuzz smoke (${{ matrix.target }})
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: [header, merkle, slip132, bip39, address, coinamount, walletdoc, encfile, peers]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
# Random-input smoke run of each untrusted-input parser; any escaping exception fails the job.
|
||||
# The coverage-guided campaign (afl++) stays a manual step, see tests/PalladiumWallet.Fuzz/fuzz.sh.
|
||||
- name: Fuzz ${{ matrix.target }}
|
||||
run: dotnet run -c Release --project tests/PalladiumWallet.Fuzz -- ${{ matrix.target }} --random 20000
|
||||
|
||||
docs:
|
||||
name: Docs checks
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check docs
|
||||
run: ./docs/check-docs.sh
|
||||
Reference in new issue
Block a user