CI CD - Memory-Lane-COS301/miniproject-2023 GitHub Wiki

Testing in GitHub

Any tests you want done on code should be automatically run anytime you commit or pull any of your code. The results for these test will be shown in the actions tab of our GitHub main page. If a test fails you are able to see the specific reason for the fail by clicking test and seeing the errors that resulted. Next to the Test there will be a red cross. When the red cross is clicked it will show a "Details" link. If this link is clicked it will take you to the workflow page where you can navigate to the step that failed (This step will be a dropdown section with a big red cross). Here you can see what failed and why it failed.

Linter

When pushing, pulling or merging with either Dev or main your code will have to pass the linter test. The linter will check the syntax and standard of your code (doesn't check if the code breaks anything).
It will fail for not having an empty line at the end or whitespaces at the end of the line
When committing to 'dev' there are files implemented which will automatically perform 'Prettier' on your code, which will remove any of the above issues.
However when pulling into dev these files won't be implemented and your code may fail due to the above issues. Therefore you will need to run prettier on your code before opening the pull request.

Unit Tests

Currently all Front-end Unit Tests are being automatically compiled using NX in our CI-CD pipeline. These tests will automatically start compiling each time a developer pushes any local changes to a branch on the repository. We are using the JEST framework for all or unit tests in this project.

Builds

There is a CI-CD workflow that automatically builds the "api" and "app" part of our project. Each time a developer pushes any local changes to a branch on the repository it will trigger the build workflow and validate that the application builds successfully. If that's not the case, the developer ca go and check the logs to see where the build failed.

Deployment

Currently we are not doing automatic deployment because of firebase's security reasons.

Branch Rules

When trying to pull a branch into another branch the checks are made with regards to the linter, unit tests and building. In practice these are all supposed to pass before the merge is made.