0
0
Jenkinsdevops~10 mins

Jenkins to GitHub Actions path - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a GitHub Actions workflow trigger for push events.

Jenkins
on: [1]
Drag options to blanks, or click blank then click option'
Apush
Bpull_request
Cschedule
Dworkflow_dispatch
Attempts:
3 left
💡 Hint
Common Mistakes
Using pull_request instead of push for push events.
2fill in blank
medium

Complete the code to specify the job runner environment in GitHub Actions.

Jenkins
jobs:
  build:
    runs-on: [1]
Drag options to blanks, or click blank then click option'
Amacos-latest
Bwindows-latest
Cubuntu-latest
Dself-hosted
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing windows-latest when Linux is expected.
3fill in blank
hard

Fix the error in the GitHub Actions step to run a shell command.

Jenkins
steps:
  - name: Run tests
    run: [1]
Drag options to blanks, or click blank then click option'
Aexecute npm test
Bnpm test
Cnpm-test
Drun npm test
Attempts:
3 left
💡 Hint
Common Mistakes
Adding extra words like 'run' or 'execute' before the command.
4fill in blank
hard

Fill both blanks to define a step that checks out the repository code in GitHub Actions.

Jenkins
steps:
  - name: Checkout code
    uses: [1]
    with:
      [2]: 'v3'
Drag options to blanks, or click blank then click option'
Aactions/checkout@v3
Bactions/setup-node@v3
Cref
Dnode-version
Attempts:
3 left
💡 Hint
Common Mistakes
Using setup-node action instead of checkout.
Using 'node-version' instead of 'ref'.
5fill in blank
hard

Fill all three blanks to define a job that installs dependencies, runs tests, and builds the project.

Jenkins
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]
Drag options to blanks, or click blank then click option'
Anpm install
Bnpm test
Cnpm run build
Dnpm start
Attempts:
3 left
💡 Hint
Common Mistakes
Running tests before installing dependencies.
Using 'npm start' instead of 'npm run build' for building.