Skip to content

alefais/epicode-cicd-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run the CI/CD demo project

Starter repository for the T4-02.05 — Let's Build a Simple CI/CD Pipeline with GitHub Actions hands-on lesson.

The app logic and the required dependencies are provided here.

Code repo structure

src/
  calculator.js       ← four arithmetic functions
test/
  calculator.test.js  ← Jest test suite
package.json          ← scripts: test, lint
package-lock.json     ← locked deps versions
.eslintrc.json        ← ESLint configuration

Running locally

npm install
npm test        # run Jest
npm run lint    # run ESLint

Exercise

This repo is intentionally missing a .github/workflows/ folder.
Your task in the lesson is to add ci.yml and wire up the GitHub Actions pipeline.

See the lesson slides and video for step-by-step instructions.

Solution

A complete CI configuration can be found in the ci-cd branch.

Note:

You will notice that, in this case, the CI workflow is configured to run when you push directly to the ci-cd branch, and when someone opens a PR against ci-cd.

on:
    push:
        branches: [ ci-cd ]
    pull_request:
        branches: [ ci-cd ]

If you want the workflow to run when you push directly to main, and when someone opens a PR against main, you'll have to change the branch name to main.

About

Example CI/CD workflow used for the Lecture 'T4-02.05-Let's Build a Simple CI/CD Pipeline with GitHub Actions', part of the Cloud Development and Ops course of the EPICODE BSc in Computer Engineering & AI

Topics

Resources

Stars

Watchers

Forks

Contributors