Skip to content

Add GitHub Actions CI workflow#23

Open
thc1006 wants to merge 3 commits into
developfrom
enh/ci-workflow
Open

Add GitHub Actions CI workflow#23
thc1006 wants to merge 3 commits into
developfrom
enh/ci-workflow

Conversation

@thc1006
Copy link
Copy Markdown
Member

@thc1006 thc1006 commented May 17, 2026

TLDR: Adds .github/workflows/ci.yml so 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.yml with two jobs:
    • lint -- ruff check + ruff format --check over BalloonPoppingGymEnv/ and tests/.
    • test -- checks out the ActiveRocketPy submodule, installs with pip install -r requirements-dev.txt, runs pytest tests/ with coverage, uploads coverage.xml as an artifact, and uploads to Codecov.
    • Triggers: pushes to main, all pull requests, and workflow_dispatch.
  • tests/test_import_smoke.py -- import smoke test for the package (BalloonPoppingGymEnv) and the example agents (BalloonPoppingGymEnv/agents/example_agents.py).
  • pytest-cov added to the dev extra in pyproject.toml for coverage generation.
  • .gitignore entries for pytest/coverage artifacts.

Decisions

  • pip, not uv. develop has no uv.lock yet (uv adoption is PR Add uv as the recommended environment setup path #20, still open), so CI installs with pip. The install step can switch to uv sync in a follow-up once Add uv as the recommended environment setup path #20 lands -- this PR is intentionally decoupled from it.
  • Python 3.14, single version, matching the project's current target.
  • push is scoped to main per the issue checklist. PRs targeting develop are still covered by the pull_request trigger.
  • Codecov -- the upload step is wired but gated on a CODECOV_TOKEN repo secret (if: env.CODECOV_TOKEN != ''). It skips cleanly until the secret is configured, then activates with no further changes. fail_ci_if_error: false and 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 -- pass
  • pytest tests/ --cov -- 10 passed, coverage.xml generated (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

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>
Copilot AI review requested due to automatic review settings May 17, 2026 23:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

thc1006 added 2 commits May 18, 2026 07:42
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>
@zuorenchen
Copy link
Copy Markdown
Member

@William-Mou, could you help review this? You're more suitable for this topic

@thc1006 thc1006 requested a review from William-Mou May 18, 2026 20:52
@thc1006 thc1006 self-assigned this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants