Add API health endpoint /api/ping with authentication validation #162
Workflow file for this run
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: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps chromium | |
- name: Build application | |
run: npm run build | |
- name: Run linting | |
run: npm run lint | |
- name: Run Playwright tests | |
run: npm run test | |
env: | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
# This job will be required for merging PRs | |
tests-required: | |
runs-on: ubuntu-latest | |
needs: test | |
if: always() | |
steps: | |
- name: Check test results | |
run: | | |
if [ "${{ needs.test.result }}" != "success" ]; then | |
echo "Tests failed or were cancelled" | |
exit 1 | |
fi | |
echo "All tests passed!" |