Merge pull request #1 from jeffstall/feature/outlook-cli-v1 #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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: Run unit tests | |
| run: npm run test:ci | |
| - name: Generate test report | |
| if: always() | |
| run: npm run test:report:markdown > test-results/report.md 2>&1 || true | |
| - 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 -warnaserror- | |
| - 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 |