diff --git a/.github/workflows/ci-e2e.yml b/.github/workflows/ci-e2e.yml deleted file mode 100644 index ce94f3d..0000000 --- a/.github/workflows/ci-e2e.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: CI + E2E - -on: - push: - branches: [main] - pull_request: - workflow_dispatch: - -jobs: - e2e: - runs-on: self-hosted - timeout-minutes: 10 - steps: - - name: Run E2E tests - id: e2e - run: | - cd /home/clems/mascarade/web - BASE_URL=http://localhost:3100 npx playwright test --reporter=line 2>&1 | tee /tmp/e2e-output.txt - PASSED=$(grep -oP '\d+ passed' /tmp/e2e-output.txt | grep -oP '\d+' || echo 0) - FAILED=$(grep -oP '\d+ failed' /tmp/e2e-output.txt | grep -oP '\d+' || echo 0) - echo "passed=$PASSED" >> $GITHUB_OUTPUT - echo "failed=$FAILED" >> $GITHUB_OUTPUT - if [ "${FAILED:-0}" != "0" ] && [ "${FAILED:-0}" != "" ]; then exit 1; fi - - - name: Notify ntfy on failure - if: failure() - run: | - curl -s -d "E2E FAILED: ${{ steps.e2e.outputs.failed }} tests failed on $(date '+%H:%M')" \ - -H "Title: Ops ER E2E Failed" \ - -H "Priority: high" \ - -H "Tags: rotating_light" \ - https://ntfy.saillant.cc/ops-alerts 2>/dev/null || true - - - name: Notify ntfy on success - if: success() - run: | - curl -s -d "E2E OK: ${{ steps.e2e.outputs.passed }} passed" \ - -H "Title: Ops ER E2E Pass" \ - -H "Priority: low" \ - -H "Tags: white_check_mark" \ - https://ntfy.saillant.cc/ops-alerts 2>/dev/null || true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..eb09215 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install + run: npm ci + + - name: Typecheck + run: npm run typecheck + + - name: Build + run: npm run build + + - name: Notify ntfy on failure + if: failure() + run: | + curl -s -d "CI FAILED on ${{ github.ref_name }} @ $(date '+%H:%M') — ${{ github.sha }}" \ + -H "Title: ER github.io CI Failed" \ + -H "Priority: high" \ + -H "Tags: rotating_light" \ + https://ntfy.saillant.cc/ops-alerts 2>/dev/null || true