From 797e8698dd2f71e4868ee914533638b81c245652 Mon Sep 17 00:00:00 2001 From: nagamani Date: Mon, 8 Dec 2025 18:16:24 -0500 Subject: [PATCH 1/4] Added test action --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..bc4fac6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Build and test + +on: + push: + branches: ["development"] # Triggered when a commit is pushed to the development branch + +jobs: + build: + runs-on: ubuntu-latest # Run this code on a Linux Virtual Machine (VM) + + steps: # Steps that are executed for this Action + # Checks out the code into the VM + - name: Checkout repository + uses: actions/checkout@v4 + + # Installs Python + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + # Installs the dependencies + - name: Install Dependencies + run: pip install -r requirements.txt + + # Discovers and runs the tests + - name: Run tests + run: pytest -q From d1783504e89459c96efe3ea1ddb69b73546540d0 Mon Sep 17 00:00:00 2001 From: nagamani Date: Mon, 8 Dec 2025 18:19:36 -0500 Subject: [PATCH 2/4] Added test action --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc4fac6..6f5ec86 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: Build and test on: push: - branches: ["development"] # Triggered when a commit is pushed to the development branch + branches: ["dvelopment"] # Triggered when a commit is pushed to the development branch jobs: build: From d6c620d1f06db250a53ee967b18a2c6b4604db9a Mon Sep 17 00:00:00 2001 From: nagamani Date: Mon, 8 Dec 2025 18:22:07 -0500 Subject: [PATCH 3/4] Added test action --- tests/test_delivery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_delivery.py b/tests/test_delivery.py index 76d00e1..ee2ae85 100644 --- a/tests/test_delivery.py +++ b/tests/test_delivery.py @@ -22,7 +22,7 @@ def fixed_weather(): def test_basic_delivery_normal_mode(): """Earth is 0.5 lm away; NORMAL speed 10 lm/hr → 0.05 hr.""" - assert estimate_delivery_time("Earth", DeliveryMode.NORMAL, 1.0, no_weather) == 0.06 # Fix this! It should be 0.05 + assert estimate_delivery_time("Earth", DeliveryMode.NORMAL, 1.0, no_weather) == 0.05 # Fix this! It should be 0.05 def test_turbo_delivery(): From a07ceeb6c4d56ce814f648dfaefb494bfef3598c Mon Sep 17 00:00:00 2001 From: nagamani Date: Mon, 8 Dec 2025 18:28:08 -0500 Subject: [PATCH 4/4] Added release file --- .github/workflows/release.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ab0f044 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Update version and add release notes to README + +on: + pull_request: + types: [opened] # Only executed when a new PR is created + +permissions: # Required for the Action to change our version and README files + contents: write + pull-requests: write + +jobs: + update_readme: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + # Calls a Python script to increase the version number in `__version__.py` + - name: Increase version number + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + python deployment_scripts/update_version_number.py + + # Calls a Python script to update the release notes in `README.md` + - name: Update release notes + env: + PR_TITLE: ${{ github.event.pull_request.title }} + PR_BODY: ${{ github.event.pull_request.body }} + run: | + python deployment_scripts/update_release_notes.py + + # Commits the changes the script made to `__version__.py` and `README.md` + - name: Commit changes + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add __version__.py + git add README.md + git commit -m "Add release notes for PR #${{ github.event.pull_request.number }}" || echo "No changes to commit" + git push