From ba600792b4a54eb098583c34d23e7604bd8839af Mon Sep 17 00:00:00 2001 From: SteMat Date: Thu, 7 Nov 2024 17:05:08 +0200 Subject: [PATCH] Add instructions for GitHub Actions --- .github/workflows/tests.yml | 5 +++++ README.md | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..9d7d9f2 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,5 @@ +name: Run Tests + +on: + +jobs: diff --git a/README.md b/README.md index 04fdf5d..883920a 100644 --- a/README.md +++ b/README.md @@ -90,3 +90,23 @@ for you). Just for clarification, an item can never have its `Quality` increase above `50`, however __"Sulfuras"__ is a legendary item and as such its `Quality` is `80` and it never alters. + +# Continuous Integration + +Now that we've improved the codebase through a thorough refactor, and we've added some much-needed tests, it's time +to think about taking advantage of those. + +We'd like to only be able to merge code if the test suite passes, otherwise the PR should fail. This way we're never adding +breaking changes. To do that, we're going to create a GitHub action to run the tests on Pull Request. + +Start by looking in the [test.yml](.github/workflows/tests.yml) file. + +1. Set the trigger to be when someone opens a PR against the `main` branch +2. Create a `test` job that runs on ubuntu +3. Firstly, we'd need to get the code - Hint: what are we doing when changing out a branch +4. Secondly, we'd need to make sure the environment is set - Hint: we're using Node +5. After we make sure we have the code and the environment set, we should install all dependencies and then run the tests. + + +Stretch goal: Sometimes we're too lazy to check the status each time. It might be easier to receive an email. What should +we do to make sure we're receiving an email whenever a build passes or fails?