elixir-cloud-aai / ga4gh-sdk

Generic SDK and CLI for GA4GH API services
Apache License 2.0
4 stars 0 forks source link

ci: setup CI #32

Open JaeAeich opened 1 month ago

JaeAeich commented 1 month ago

CI

To make CI similar to that in python cookicutter, I think we can incorporate the below.

Description

  1. Create an Action to Setup Funnel:

    • Create a directory .github/actions/setup/funnel.
    • Define the Funnel setup in action.yaml.
  2. Testing:

    • Separate unit and integration tests in CI:
      • Unit tests: cargo test --verbose.
      • Integration tests: cargo test --test integration_test --verbose.
    • Generate and upload coverage to Codecov for both unit and integration tests:
      • Use cargo-tarpaulin to generate coverage reports.
      • Upload coverage reports to Codecov.
      • Add Codecov badge to README.md.
  3. Pre-commit Checks:

    • Add checks for formatting, large files, and EOF format to pre-commit.yaml.
    • Ensure checks are included in CI.
  4. PR Evaluation:

    • Copy PR evaluation workflow from the cookiecutter dev branch.
    • Add local and build jobs to the PR evaluation workflow.
  5. Docs:

    • Configure clippy to enforce documentation.
    • Decide between publishing docs to gh-pages or crates.io.
  6. Publish:

    • Add a publish CI workflow for crate releases and documentation.
  7. Issue and PR Templates:

    • Copy PULL_REQUEST_TEMPLATE.md and general-purpose.md from cookiecutter with minimal language-specific changes.
  8. Makefile:

    • Add development commands to Makefile for ease of use, based on cookiecutter's Makefile.
  9. Directory Structure Update:

    • Ensure .github directory contains:
      • actions/setup/funnel/action.yaml for Funnel setup.
      • workflows with YAML files for:
      • code_quality.yaml (format, lint, spell check).
      • code_test.yaml (unit and integration tests).
      • docs.yaml (publishing documentation).
      • pr_validation.yaml (PR evaluation and build).
      • release.yaml (crate release).
      • Add .pre-commit-config.yaml for pre-commit hooks.
      • Update .yamllint.yaml for YAML linting.

Summary

PS: @uniqueg @pavelnikonorov @aaravm please change/edit this issue as you need, I just wrote what a list of CI that I think might/would be needed :).

JaeAeich commented 1 month ago

@aaravm and I had a chat regarding CI, so here is some of my points on it.

This is in respect to dev branch.

Below is the structure for CI used in python proj using cookicutter.

.
├── actions
│   └── setup
│       └── poetry
│           └── action.yaml
├── ISSUE_TEMPLATE
│   └── general-purpose.md
└── workflows
    ├── code_quality.yaml
    ├── code_test.yaml
    ├── docs.yaml
    ├── pr_validation.yaml
    ├── release.yaml
    ├── update.yaml
    └── vulnerability.yaml
.
├── .github
│   ├── actions
│   │   └── setup
│   │       └── funnel
│   │           └── action.yaml  // Setup funnel
│   ├── ISSUE_TEMPLATE
│   │   └── general-purpose.md  // Copy from cookicutter.
│   └── workflows
│       ├── code_quality.yaml  // Format (fmt), and lint (clippy), and spell check (https://crates.io/crates/cargo-spellcheck)
│       ├── code_test.yaml  // 2 jobs integration and unit tests.
│       ├── docs.yaml  // dependends on if you choose to publish.
│       ├── pr_validation.yaml // Copy from cookicutter and then add build step here as well.
│       ├── release.yaml  // Crate release CI
├── .gitignore
├── images
│   ├── logo-elixir-cloud-aai.svg
│   └── logo-elixir.svg
├── LICENSE
├── Makefile  // To make dev easy, add dev commands here, look into cookicutter's makefile.
├── .pre-commit-config.yaml
├── PULL_REQUEST_TEMPLATE.md
├── Cargo.toml
├── lib
├── README.md
├── tests
└── .yamllint.yaml  // Use this to enforce yaml linting in pre-commit in CI.

PS: @uniqueg @pavelnikonorov thoughts?

uniqueg commented 1 month ago

This sounds great - very thorough work both! Thanks a lot for the help @JaeAeich.

No further comments from my side.