Challenge - 5 Problems
Express CI/CD Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this GitHub Actions step?
Given this GitHub Actions step in a CI pipeline for an Express app, what will be the output if the tests fail?
Express
steps:
- name: Run tests
run: npm testAttempts:
2 left
💡 Hint
By default, a failing command in GitHub Actions stops the job.
✗ Incorrect
In GitHub Actions, if a command like 'npm test' fails (returns non-zero), the job stops and is marked failed unless you explicitly allow failure.
❓ Configuration
intermediate2:00remaining
Which Dockerfile snippet correctly sets up an Express app for production?
Choose the Dockerfile snippet that correctly installs dependencies and starts the Express app in production mode.
Attempts:
2 left
💡 Hint
Production installs only needed packages and uses the correct start file.
✗ Incorrect
Option D installs only production dependencies and starts the app with 'node server.js', which is typical for Express apps in production.
🔀 Workflow
advanced3:00remaining
What is the correct order of steps in a CI/CD pipeline for an Express app?
Arrange these steps in the correct order for a typical CI/CD pipeline deploying an Express app.
Attempts:
2 left
💡 Hint
Code must be pushed before tests run, then build and deploy.
✗ Incorrect
First, code is pushed (4), then tests run (1), then Docker image is built (2), and finally deployed (3).
❓ Troubleshoot
advanced2:00remaining
Why does this GitHub Actions step fail with 'npm: command not found'?
In a GitHub Actions workflow for an Express app, this step fails:
- name: Install dependencies
run: npm install
What is the most likely cause?
Attempts:
2 left
💡 Hint
Check if Node.js is available on the runner environment.
✗ Incorrect
If 'npm' is not found, it usually means Node.js is not installed or PATH is not set correctly on the runner.
✅ Best Practice
expert3:00remaining
Which practice improves CI/CD pipeline speed for Express apps?
Select the best practice to speed up the CI/CD pipeline when building Docker images for Express apps.
Attempts:
2 left
💡 Hint
Separating layers helps Docker cache dependencies and avoid reinstalling them every build.
✗ Incorrect
Multi-stage builds and caching dependencies speed up builds by reusing layers when code changes but dependencies don't.