Summary - CI/CD and monitoring
- React course
- Advanced
- Lesson 52/56
- 5 min
Write a workflow with lint, test and build steps.
Summary - CI/CD and monitoring
In this group you learned CI/CD pipelines, GitHub Actions workflows and performance monitoring.
On every push build and test run automatically; quality thresholds are set with Web Vitals and Lighthouse. Secrets live on the platform, not in the repo.
Now you will write a cached build and test workflow.
Practice Write the Test workflow
Write a test workflow. Use name: Test, on: push. Set up setup-node@v4 with node-version: '20' and cache: 'npm'. Run npm ci && npm test.
Starter code
# Write the Test workflow hereSample solution
name: Test
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci && npm testQuestions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which of the following is wrong?
- secrets are not written to the repo
- cache shortens npm ci time
- Lighthouse gives an accessibility score
- Web Vitals runs only on the server Correct answer
Explanation: Web Vitals runs on the client side.
2 Fill in the blank: checkout action
steps:
- uses: actions/____@v4
steps:
- uses: actions/checkout@v4
Explanation: answer: checkout. actions/checkout@v4 pulls the code.
3 Match concepts
| Term | Meaning |
|---|---|
CI |
Merges changes |
cache |
Saves time |
Lighthouse |
Gives scores |
secrets |
Hidden keys |