Skip to content

Commit

Permalink
feat: add documentation for workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gerbie-goober committed Aug 5, 2024
1 parent 2b414db commit 54c907c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## **To run this CI/CD Workflow:**
- Simply, make a PR to the `main` branch or push changes to the `main` branch
- Go to the `Actions` Tab to view the status of the workflow.

## Details of Implementation
- **CI Pipeline**
- Specify that the CI Pipeline is triggered on PR or push to `main`
- Checkout code via `Github Actions`
- Install `docker-compose`
- Log in to Docker Hub
- Run `docker-compose build` to build frontend and backend images
- **Note**: we have defined a redis container within the docker-compose file in case that we want to implement a test suite that requires redis to run
- Tag frontend and backend images and push them to Docker Hub
- List docker images
- **CD Pipeline**
- Specify workflow to run only after CI Pipeline has been completed
- Run code on `ubuntu-latest`
- Checkout code via `Github Actions`
- Log in to Docker Hub
- Pull Docker backend and frontend images
- Deploy backend and frontend containers
- Run Automated Tests on backend and frontend
- We first install necessary packages (i.e. `npm install`)
- Then, we run `npm test` for the respective containers each having their own test suite

24 changes: 24 additions & 0 deletions .github/workflows/SystemDesign.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## **System Design for Building, Pushing, Deploying Docker**
### **CI Pipeline**
- `A2_Part1.yml` file
- Responsible for building docker images for the frontend and backend and pushing them to DockerHub
- `A2_Part2.yml` file
- Responsible for pulling frontend and backend containers and running automated tests within their respective containers



## **System Design for Automated Testing**
### **Backend**
- In `package.json`:
- `npm test`
- runs `jest --coverage --forceExit --maxWorkers=2`
- In `__ tests __` :
- `setProfilePic.test.js`
- verify that making `POST` request at `/set-profile-pic` endpoint results in 200 response code
### **Frontend**
- In `package.json`:
- `npm test`
- runs `jest --coverage --transformIgnorePatterns \"node_modules/(?!axios)/\"`
- In `__ tests __` :
- `LoginPage.test.js`:
- check that the Login component contains the phrase “Swipe. Match. Network.”

0 comments on commit 54c907c

Please sign in to comment.