Skip to content

feat: add WHY comments to tests, C# --latest-reply, bridge auto-start… #11

feat: add WHY comments to tests, C# --latest-reply, bridge auto-start…

feat: add WHY comments to tests, C# --latest-reply, bridge auto-start… #11

Workflow file for this run

# CI — Unit Tests + NativeAOT Build
#
# Runs on every push and PR. Fast feedback loop (~2-3 min).
# - Node.js unit tests on Ubuntu + Windows
# - C# build + NativeAOT publish on Windows
# - Test report generation and artifact upload
#
# Integration tests (requiring M365 credentials) run separately
# via integration.yml on manual dispatch or nightly schedule.
name: CI
on:
push:
branches: [main, 'feature/**']
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
# ── Node.js Unit Tests ────────────────────────────────────────────────
unit-tests:
name: Unit Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint (ESLint)
run: npm run lint
- name: Run unit tests
run: npm run test:ci
continue-on-error: true
id: tests
- name: Run coverage
if: matrix.os == 'ubuntu-latest'
run: npm run test:coverage -- --reporter=json --outputFile=test-results/coverage.json
continue-on-error: true
- name: Generate test report
if: always()
run: |
mkdir -p test-results 2>/dev/null || mkdir test-results 2>nul || true
node scripts/test-report.js --markdown > test-results/report.md 2>&1 || echo "Report generation failed"
shell: bash
- name: Fail if tests failed
if: steps.tests.outcome == 'failure'
run: exit 1
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}
path: test-results/
retention-days: 30
- name: Post test summary to PR
if: always() && github.event_name == 'pull_request'
run: |
if [ -f test-results/report.md ]; then
echo "## 🧪 Test Results (${{ matrix.os }})" >> $GITHUB_STEP_SUMMARY
cat test-results/report.md >> $GITHUB_STEP_SUMMARY
fi
shell: bash
# ── C# Build ──────────────────────────────────────────────────────────
dotnet-build:
name: C# Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore src/dotnet/OutlookCli.csproj
- name: Build (Debug)
run: dotnet build src/dotnet/OutlookCli.csproj --no-restore /p:TreatWarningsAsErrors=false
- name: Verify CLI help
run: dotnet run --project src/dotnet -- --help
# ── NativeAOT Publish ─────────────────────────────────────────────────
nativeaot:
name: NativeAOT (${{ matrix.rid }})
runs-on: ${{ matrix.os }}
needs: dotnet-build
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
rid: win-x64
ext: .exe
- os: ubuntu-latest
rid: linux-x64
ext: ""
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Publish NativeAOT
run: >
dotnet publish src/dotnet/OutlookCli.csproj
-r ${{ matrix.rid }}
--self-contained
/p:PublishAot=true
-o publish/${{ matrix.rid }}
- name: Verify binary runs
run: ./publish/${{ matrix.rid }}/outlook-cli${{ matrix.ext }} --help
shell: bash
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: outlook-cli-${{ matrix.rid }}
path: publish/${{ matrix.rid }}/
retention-days: 90