Skip to content

Fix connected IPNS version pruning #11

Fix connected IPNS version pruning

Fix connected IPNS version pruning #11

name: Apply IPNS connected pruning fix
on:
push:
branches:
- agent/fix-ipns-connected-pruning
paths:
- ".github/workflows/apply-ipns-connected-pruning-fix.yml"
- "scripts/apply-ipns-connected-pruning-fix.py"
pull_request:
branches:
- master
paths:
- ".github/workflows/apply-ipns-connected-pruning-fix.yml"
- "scripts/apply-ipns-connected-pruning-fix.py"
permissions:
contents: write
jobs:
patch-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Apply focused source patch
run: python3 scripts/apply-ipns-connected-pruning-fix.py
- name: Restore solution
run: dotnet restore TruthGate-IPFS.sln
- name: Restore focused tests
run: dotnet restore TruthGate-Web/TruthGate-Web.Tests/TruthGate-Web.Tests.csproj
- name: Build solution
run: dotnet build TruthGate-IPFS.sln --no-restore --configuration Release
- name: Run connected pruning tests
id: focused
continue-on-error: true
shell: bash
run: |
set -o pipefail
dotnet test \
TruthGate-Web/TruthGate-Web.Tests/TruthGate-Web.Tests.csproj \
--no-restore \
--configuration Release \
--filter "FullyQualifiedName~IpnsVersionRetentionTests" \
--logger "console;verbosity=normal" \
2>&1 | tee connected-pruning-test.log
- name: Commit compiled fix and output
run: |
branch="${{ github.head_ref || github.ref_name }}"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add \
TruthGate-Web/TruthGate-Web/Services/IpnsUpdateWorker.cs \
TruthGate-Web/TruthGate-Web/Services/IpnsVersionRetention.cs \
TruthGate-Web/TruthGate-Web/Properties/AssemblyInfo.cs \
TruthGate-Web/TruthGate-Web.Tests/IpnsVersionRetentionTests.cs
git add -f connected-pruning-test.log
git commit -m "Fix connected IPNS version pruning"
git push origin HEAD:"$branch"
- name: Fail when focused tests failed
if: steps.focused.outcome != 'success'
run: exit 1