build: streamline CI and container workflows #10
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
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| collection: | |
| name: Collection · Shared Kernel | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: collection/collectors/Heartbeat.Collector.Browser/package-lock.json | |
| - name: Verify Browser Collector | |
| working-directory: collection/collectors/Heartbeat.Collector.Browser | |
| run: | | |
| npm ci | |
| npm test | |
| npm run build | |
| - name: Verify Collector Fact contracts | |
| env: | |
| CONTRACT_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} | |
| run: node scripts/collector-contracts.mjs check --base-ref "$CONTRACT_BASE_REF" | |
| - uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore Collection test dependencies | |
| run: dotnet restore Heartbeat.Collection.Tests.slnf | |
| - name: Build Collection tests | |
| run: dotnet build Heartbeat.Collection.Tests.slnf -c Release --no-restore | |
| - name: Run Collection and Shared Kernel tests | |
| run: dotnet test Heartbeat.Collection.Tests.slnf -c Release --no-build --no-restore | |
| analytics: | |
| name: Analytics | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| # Server test builds stage the System Collector Package through a Node script. | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Run Analytics integration tests | |
| run: dotnet test server/Heartbeat.Server.Tests/Heartbeat.Server.Tests.csproj -c Release | |
| desktop_macos: | |
| name: Desktop · macOS | |
| runs-on: macos-15 | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Run macOS platform tests | |
| run: dotnet test collection/desktop/Heartbeat.Desktop.Mac.Tests/Heartbeat.Desktop.Mac.Tests.csproj -c Release | |
| desktop_windows: | |
| name: Desktop · Windows | |
| runs-on: windows-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Verify Browser Collector package on Windows | |
| shell: bash | |
| run: | | |
| npm ci --prefix collection/collectors/Heartbeat.Collector.Browser | |
| npm run build --prefix collection/collectors/Heartbeat.Collector.Browser | |
| node scripts/collector-contracts.mjs check | |
| - name: Run Windows platform tests | |
| run: dotnet test collection/desktop/Heartbeat.Desktop.Windows.Tests/Heartbeat.Desktop.Windows.Tests.csproj -c Release | |
| dashboard: | |
| name: Dashboard | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install Dashboard dependencies | |
| working-directory: frontend | |
| run: npm ci | |
| - name: Verify Dashboard | |
| working-directory: frontend | |
| run: npm run verify |