Skip to content

Add CI with pre-commit and smoke tests#1

Merged
Yong2Sheng merged 4 commits intodevelopfrom
feature/env_management
Feb 12, 2026
Merged

Add CI with pre-commit and smoke tests#1
Yong2Sheng merged 4 commits intodevelopfrom
feature/env_management

Conversation

@Yong2Sheng
Copy link
Owner

Summary

This PR adds lightweight GitHub Actions CI for the ResearchCodes repo and aligns local tooling so checks are reliable across machines.

What changed

  • Add GitHub Actions workflow with two jobs:
    • pre-commit job runs repository hooks on all files in CI.
    • smoke job builds the conda environment from environment.yml and runs pytest -m smoke import checks.
  • Tighten pre-commit hooks so auto-fix hooks only touch code and config files (prevents accidental edits to data files).
  • Fix pytest configuration so smoke tests are discoverable in CI (tests directory is tracked, pytest marker registered).
  • Clean up .gitignore to stop ignoring tests/ and remove unrelated project-specific ignore rules.

Why

  • CI provides a clean-environment verification that environment.yml includes all required dependencies and that imports succeed.
  • Running pre-commit in CI gives a consistent gate even if local hooks are skipped.
  • Limiting auto-fix hooks avoids unintended modifications to important non-code data files.

How to test

  • Local: pre-commit run --all-files --hook-stage pre-push
  • Local: pytest -q -m smoke -x -ra
  • CI: GitHub Actions runs both jobs on push and PR.

Notes

  • Smoke test failure previously occurred because no tests were collected (pytest exit code 5) when tests/ was ignored; this PR ensures tests are tracked and discoverable.

@Yong2Sheng Yong2Sheng merged commit 4875079 into develop Feb 12, 2026
4 checks passed
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.

1 participant