diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 4685e1d..9f9c4b7 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -34,10 +34,24 @@ jobs: "https://github.com/eriknihlen/OpenAC/releases/download/${OPENAC_API_RELEASE_TAG}/AcDream.Plugin.Abstractions.${OPENAC_API_VERSION}.nupkg" - name: Build - run: dotnet build OpenAC.MosswartMassacre.slnx -c Release --nologo + run: dotnet build OpenAC.MosswartMassacre.slnx -c Release --nologo 2>&1 | tee -a ci.log; exit ${PIPESTATUS[0]} + shell: bash - name: Test - run: dotnet test OpenAC.MosswartMassacre.slnx -c Release --no-build --nologo + run: dotnet test OpenAC.MosswartMassacre.slnx -c Release --no-build --nologo 2>&1 | tee -a ci.log; exit ${PIPESTATUS[0]} + shell: bash + + - name: Temporary - post the failure output + if: failure() + env: + TOKEN: ${{ secrets.FORGEJO_TOKEN }} + run: | + (dotnet --info 2>&1 | head -20; echo ----; tail -c 6000 ci.log 2>/dev/null) > diag.txt || true + python3 -c 'import json,sys; print(json.dumps({"body": "CI failure output: +``` +" + open("diag.txt", errors="replace").read() + " +```"}))' > diag.json + curl -fsS -X POST -H "Authorization: token $TOKEN" -H "Content-Type: application/json" -d @diag.json "${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/issues/2/comments" > /dev/null release: # Tag pushes only, once the build and tests are green.