Add GitHub Actions CI workflow#23
Open
thc1006 wants to merge 3 commits into
Open
Conversation
Set up .github/workflows/ci.yml with a lint job (ruff check and format check) and a test job that installs the project with its ActiveRocketPy submodule, runs the suite with coverage, and uploads a coverage report. CI runs on pushes to main, pull requests, and manual dispatch. The Codecov upload step stays dormant until a CODECOV_TOKEN secret is configured. Add tests/test_import_smoke.py to confirm the package and example agents import after an install, and declare pytest-cov as a dev dependency for coverage generation. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
actions/checkout@v4, actions/setup-python@v5 and actions/upload-artifact@v4 run on Node 20, which GitHub deprecates in June 2026. Move them to the current majors (v6, v6, v7), which run on Node 24. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
The skip guard used importlib.import_module, which executes rocketpy and so cannot tell an installed-but-broken stack apart from an absent one -- test_import_example_agents would skip the import breakage it exists to catch. find_spec checks installation without importing, so the test runs and fails loudly when an installed stack is broken. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
Member
|
@William-Mou, could you help review this? You're more suitable for this topic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR: Adds
.github/workflows/ci.ymlso the repo gets automated lint, format, unit-test and import checks on every PR. Covers all of issue #21's Required and Recommended scope; the Optional/Future items stay as the follow-up issues #21 already lists.What this adds
.github/workflows/ci.ymlwith two jobs:lint--ruff check+ruff format --checkoverBalloonPoppingGymEnv/andtests/.test-- checks out theActiveRocketPysubmodule, installs withpip install -r requirements-dev.txt, runspytest tests/with coverage, uploadscoverage.xmlas an artifact, and uploads to Codecov.main, all pull requests, andworkflow_dispatch.tests/test_import_smoke.py-- import smoke test for the package (BalloonPoppingGymEnv) and the example agents (BalloonPoppingGymEnv/agents/example_agents.py).pytest-covadded to thedevextra inpyproject.tomlfor coverage generation..gitignoreentries for pytest/coverage artifacts.Decisions
develophas nouv.lockyet (uv adoption is PR Add uv as the recommended environment setup path #20, still open), so CI installs withpip. The install step can switch touv syncin a follow-up once Add uv as the recommended environment setup path #20 lands -- this PR is intentionally decoupled from it.pushis scoped tomainper the issue checklist. PRs targetingdevelopare still covered by thepull_requesttrigger.CODECOV_TOKENrepo secret (if: env.CODECOV_TOKEN != ''). It skips cleanly until the secret is configured, then activates with no further changes.fail_ci_if_error: falseand no coverage threshold, so CI never fails on coverage alone.Validated locally
On a fresh Python 3.14 virtualenv, mirroring the CI steps:
pip install -r requirements-dev.txt-- clean install (ActiveRocketPy submodule, ruff, pytest, pytest-cov included)ruff check/ruff format --check-- passpytest tests/ --cov-- 10 passed,coverage.xmlgenerated (24% total; not gated)Out of scope
Nightly/manual E2E evaluation, multi-seed regression checks, reward/performance tracking, Dependabot, and CodeQL are left as the follow-up issues listed in #21.
Closes #21