Complete the code to define a GitHub Actions workflow trigger for push events.
on: [1]The on key defines the event that triggers the workflow. For push events, use push.
Complete the code to specify the job runner environment in GitHub Actions.
jobs:
build:
runs-on: [1]The runs-on key sets the virtual machine environment. ubuntu-latest is a common choice for Linux runners.
Fix the error in the GitHub Actions step to run a shell command.
steps:
- name: Run tests
run: [1]The run key expects a shell command. npm test is the correct command to run tests.
Fill both blanks to define a step that checks out the repository code in GitHub Actions.
steps:
- name: Checkout code
uses: [1]
with:
[2]: 'v3'The actions/checkout@v3 action checks out the code. The ref input specifies the branch or tag version.
Fill all three blanks to define a job that installs dependencies, runs tests, and builds the project.
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: [1]
- name: Run tests
run: [2]
- name: Build project
run: [3]First, install dependencies with npm install. Then run tests with npm test. Finally, build the project with npm run build.