This is an individual assignment. All students are required to work independently.
You are required to perform the following tasks:
- Follow this invite link to create your own individual GitHub repo. Setup GitHub Actions in the repository (see the Setting up GitHub Actions instructions in the lab slides if you are unfamiliar with this).
- Create a workflow file to set up GitHub Action to run the
npm test
command on merge/commit. - Add a continuous integration build badge to your README.
- The repo should already contain a Typescript project with the following files:
- Calculator.ts: a class that adds and multiplies sets of Integers
- StringCheck.ts: a class that checks if a string is a palindrome, is empty, is null, or contains only whitespace.
- CalculatorTest.spec.ts: a test class to ensure that the Calculator class is working as intended.
- StringCheckTest.spec.ts: a test class to ensure that the StringCheck class is working as intended.
- Build and config files to satisfy the project needs.
- Use the associated Codespaces hub (see Code button on Github) or, optionally, install the required components on your machine. We cannot support installation issues.
We are using the following in this project:
- Typescript: a typed version of Javascript.
- Node: an asynchronous Javascript engine.
- NPM: the Node package manager to manage dependencies.
- Gulp: a JS build task tool.
- Mocha: A JS/TS testing framework. We don't really need this yet.
Note: You will be required to write some code to ensure that the classes are working as intended and are tested appropriately (there are comments in the files explaining this).
- Once you open the Codespace, entering
tsc
(Typescript compile) and thennpm test
in the Terminal should result in a passing test. - Create a new branch in your repository. Write the missing test cases, fix the broken test cases, and write the additional code as described in the comments in each
.ts
file. - Using a GitHub action, have GitHub automatically run the tests and return whether the merge is safe.
- Once all tests are passing, submit a Pull Request from your newly created branch to the master branch with these code changes. Do not merge the Pull Request. (or, use the GitHub VS Code plugin to do this).
- GitHub Actions should show that the pull request passes all checks.
By completing this assignment, you should demonstrate your ability to set up a continuous integration environment and write a simple test suite.
You should submit a link to your private repository before 11:59PM on the required date through the Brightspace assignment. The teaching assistants will submit additional pull requests to your repository after the assignment deadline to ensure the code works as expected and that continuous integration is setup appropriately.
- Private GitHub repository created with actions enabled
- Provided code has been fixed and completed in a new branch
- A pull request with the required code changes has been submitted
- The build shows the submitted pull request is passing all checks
- The GitHub README file includes the build status badge
- The badge on the README and the other build indicators change status appropriately when additional pull requests are submitted by the teaching team.
No late submissions. If you have a legitimate reason for submitting late, discuss this with the lecturer well in advance of the assignment due date.