A collection of reusable GitHub Actions workflows and configurations for the cvxgrp organization and beyond.
This repository contains standardized GitHub Actions workflows that can be reused across multiple projects. These workflows help automate common tasks such as:
- 🧪 Running tests and generating coverage reports
- 📄 Building LaTeX documents
- 📚 Generating documentation
- 🔍 Code quality checks and linting
- 📦 Building and publishing packages
Be careful when using actions in private repositories. The group has a limited number of minutes per month. In public repositories, actions are free.
We have removed the poetry-based actions:
- actions/test@main
- actions/sphinx@main
- actions/setup-environment@main
- actions/pdoc@main
- actions/jupyter@main
- actions/coverage@main
- actions/book@main
You have two options:
- Use cvxgrp/.github/actions/[email protected] where all those actions are still present
- Move to uv (recommended)
To take full advantage of the actions provided here, we recommend using uv. uv is a modern package manager for Python that allows you to create and manage virtual environments efficiently.
A more dated alternative is poetry.
GitHub workflows help robustify and automate the process of creating software and documents. We recommend reading the GitHub Actions introduction for more information.
Here are some example actions created for cvxgrp:
📄 latex
This workflow compiles *.tex files and uploads the generated documents to the draft branch.
🧪 test
This workflow installs pytest and related packages, runs tests, and uploads the test results as artifacts.
📚 book
This workflow builds and publishes documentation for your repository.
This workflow runs code quality checks and linting on your codebase.
Creating workflows for your own repository is simple:
- Create the
.github/workflowsfolder in your repository - Create a YAML file with the name of the workflow you want to use (e.g.,
basic.yml) - Define your workflow using the example below:
name: "basic"
on:
push:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: cvxgrp/.github/actions/[email protected]
test:
runs-on: ubuntu-latest
steps:
- name: "Build the virtual environment for ${{ github.repository }}"
uses: cvxgrp/.github/actions/[email protected]
- uses: cvxgrp/.github/actions/[email protected]
with:
coveralls: 'true'Every push to the repository will trigger the workflow. It will run all jobs defined in the workflow:
- The
pre-commitjob runs code quality checks - The
testjob builds a virtual environment, runs tests, and measures test coverage
There are many examples of workflow files in these repositories:
Note the strong overlap between both projects. Rather than coding the same workflow twice, repositories point to the actions defined here.
For a paper repository, we use the LaTeX workflow. For example:
Note that paper repositories tend to be private and are hence only visible to members of the group.
Contributions to improve these workflows are welcome. Please feel free to submit issues or pull requests.