Sequence NODE_359
MediumCreate a Simple GitHub Actions CI Workflow
Git & GitHub
Technical Specification
Set up a basic GitHub Actions workflow that runs npm test on every push and pull request to main.
Input/Output Samples
Input:open PR
Output:CI job runs tests automatically
Optimal Logic Path
# .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
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm install
- run: npm testArchitectural Deep-Dive
GitHub Actions lets you run tests automatically, catching errors before merge.