📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Git & GitHub GitHub Actions CI

GitHub Actions CI

5 min read
Automate tests and builds on every push and PR using GitHub Actions workflows.

GitHub Actions CI

# .github/workflows/ci.yml
name: CI
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm

      - run: npm ci
      - run: npm test
      - run: npm run build

      - name: Upload coverage
        uses: codecov/codecov-action@v3