Open JaeAeich opened 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
code_test.yaml
.# In unit test job
- name: Run unit tests
run: cargo test --verbose
# In integration test job
- name: Run integration tests
run: cargo test --test integration_test --verbose
# in integration test job
pre-commit.yaml
, and add a check in CI, this way dev is not obligated to pass the pre-commits to push but it give a good overview in the CI if there were any violations of checks like, wrongly formatted md file, or a extremely large file was pushed by mistake or if the files have correct EOF format. gh-pages
but maybe better would be to publish this on crates.io and not worry about docs, because then the documentation is automatically generated and hosted on docs.rs. This
# clippy.toml
warn(missing_docs)
So it would look something like
.
├── .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?
This sounds great - very thorough work both! Thanks a lot for the help @JaeAeich.
No further comments from my side.
CI
To make CI similar to that in python cookicutter, I think we can incorporate the below.
Description
Create an Action to Setup Funnel:
.github/actions/setup/funnel
.action.yaml
.Testing:
cargo test --verbose
.cargo test --test integration_test --verbose
.cargo-tarpaulin
to generate coverage reports.README.md
.Pre-commit Checks:
pre-commit.yaml
.PR Evaluation:
dev
branch.Docs:
clippy
to enforce documentation.gh-pages
orcrates.io.
Publish:
Issue and PR Templates:
PULL_REQUEST_TEMPLATE.md
andgeneral-purpose.md
from cookiecutter with minimal language-specific changes.Makefile:
Makefile
for ease of use, based on cookiecutter's Makefile.Directory Structure Update:
.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)..pre-commit-config.yaml
for pre-commit hooks..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 :).