|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, master] |
| 6 | + pull_request: |
| 7 | + branches: [main, master] |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ci-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + dotnet-build-test: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + timeout-minutes: 30 |
| 20 | + name: .NET Build and Test |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + fetch-depth: 0 |
| 25 | + |
| 26 | + - name: Setup .NET |
| 27 | + uses: actions/setup-dotnet@v4 |
| 28 | + with: |
| 29 | + dotnet-version: 8.0.x |
| 30 | + |
| 31 | + - name: Restore dependencies |
| 32 | + run: dotnet restore libs/ironconfig-dotnet/IronConfig.sln |
| 33 | + |
| 34 | + - name: Build |
| 35 | + run: dotnet build libs/ironconfig-dotnet/IronConfig.sln -c Release --no-restore |
| 36 | + |
| 37 | + - name: Run tests |
| 38 | + run: dotnet test libs/ironconfig-dotnet/IronConfig.sln -c Release --no-build --logger "console;verbosity=normal" |
| 39 | + |
| 40 | + native-build-test: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + timeout-minutes: 30 |
| 43 | + name: Native Build and Test |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v4 |
| 46 | + |
| 47 | + - name: Configure native build |
| 48 | + run: cmake -S native -B native/build |
| 49 | + |
| 50 | + - name: Build native |
| 51 | + run: cmake --build native/build --config Release |
| 52 | + |
| 53 | + - name: Run native tests |
| 54 | + run: ctest --test-dir native/build -C Release --output-on-failure |
| 55 | + |
| 56 | + docs-truth-gate: |
| 57 | + runs-on: ubuntu-latest |
| 58 | + timeout-minutes: 10 |
| 59 | + name: Enforce Documentation Truth Gate |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + |
| 63 | + - name: Verify docs truth (normative claims) |
| 64 | + run: | |
| 65 | + chmod +x ./tools/docs_truth_gate/verify_docs_truth.sh |
| 66 | + ./tools/docs_truth_gate/verify_docs_truth.sh docs/ |
| 67 | +
|
| 68 | + - name: Report |
| 69 | + if: success() |
| 70 | + run: | |
| 71 | + echo "[OK] Documentation Truth Gate PASSED" |
| 72 | + echo "All normative claims in docs/ are verifiable" |
| 73 | +
|
| 74 | + - name: Report failure |
| 75 | + if: failure() |
| 76 | + run: | |
| 77 | + echo "[FAIL] Documentation Truth Gate FAILED" |
| 78 | + echo "Found normative claims without evidence references" |
| 79 | + exit 1 |
| 80 | +
|
| 81 | + summary: |
| 82 | + runs-on: ubuntu-latest |
| 83 | + timeout-minutes: 5 |
| 84 | + name: CI Summary |
| 85 | + needs: [dotnet-build-test, native-build-test, docs-truth-gate] |
| 86 | + if: always() |
| 87 | + steps: |
| 88 | + - name: Check results |
| 89 | + run: | |
| 90 | + echo ".NET Build and Test: ${{ needs.dotnet-build-test.result }}" |
| 91 | + echo "Native Build and Test: ${{ needs.native-build-test.result }}" |
| 92 | + echo "Docs Truth Gate: ${{ needs.docs-truth-gate.result }}" |
| 93 | +
|
| 94 | + if [[ "${{ needs.dotnet-build-test.result }}" != "success" ]] || \ |
| 95 | + [[ "${{ needs.native-build-test.result }}" != "success" ]] || \ |
| 96 | + [[ "${{ needs.docs-truth-gate.result }}" != "success" ]]; then |
| 97 | + echo "CI FAILED" |
| 98 | + exit 1 |
| 99 | + fi |
| 100 | +
|
| 101 | + echo "[OK] All CI checks passed" |
| 102 | +
|
0 commit comments