Skip to content

Commit

Permalink
Add CI/CD workflows with tox and GitHub Actions for comprehensive tes…
Browse files Browse the repository at this point in the history
…ting, styling, and quality checks (#16)

## Summary
Implements a series of GitHub Actions workflows and tox environments to
streamline the CI/CD processes for the project. It replaces the previous
Makefile-based pathways and focuses on modernizing the development,
testing, and deployment practices.

## Details
- CI/CD Workflows: Introduced multiple GitHub Actions workflows for
development, nightly builds, quality checks, and releases.
- Development Workflow: Runs on pull requests to any branch. Includes
unit tests and integration tests for Python versions 3.8 to 3.12.
- Nightly Workflow: Scheduled to run nightly, ensuring continuous
integration health with the unit, integration, and end-to-end tests.
- Quality Workflow: This runs on pushes to the main branch and pull
requests. It ensures code quality with linting, formatting, and type
checking.
- Release Workflow: Triggers on push to release branches, running
comprehensive tests to prepare for new releases.
- tox Configuration: Updated tox.ini to define environments for unit
tests, integration tests, end-to-end tests, quality checks, style
checks, type checks, build, and clean operations.
- Developer Documentation: Expanded DEVELOPING.md to guide contributors
in setting up the development environment, running tests, and
maintaining code quality.
- README Updates: Updated project documentation to reflect the new CI/CD
practices and removed outdated Makefile instructions.

## Test Plan
Pending running the new GitHub Actions workflows. If any issues pop up,
those will be fixed either in this diff or in subsequent ones.
  • Loading branch information
markurtz authored Jul 24, 2024
1 parent 361f7c6 commit 051df6b
Show file tree
Hide file tree
Showing 10 changed files with 509 additions and 210 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/code-quality.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Development

on:
pull_request:
branches:
- '**'

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run unit tests
run: tox -e test-unit -- -m "smoke or sanity"

integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run integration tests
run: tox -e test-integration -- -m smoke
69 changes: 69 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Nightly

on:
schedule:
- cron: '0 0 * * *' # Runs at midnight every night

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run unit tests
run: tox -e test-unit -- --cov-report=term-missing --cov --cov-fail-under=75

integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run integration tests
run: tox -e test-integration -- -m "smoke or sanity"

e2e-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run e2e tests
run: tox -e test-e2e -- -m smoke
46 changes: 46 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Quality

on:
push:
branches:
- main
pull_request:
branches:
- '**'

jobs:
quality-check:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run quality checks
run: tox -e quality

type-check:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run type checks
run: tox -e types
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
push:
branches:
- release/**

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run unit tests
run: tox -e test-unit -- --cov-report=term-missing --cov --cov-fail-under=75

integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run integration tests
run: tox -e test-integration -- --cov-report=term-missing --cov --cov-fail-under=75

e2e-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run e2e tests
run: tox -e test-e2e -- --cov-report=term-missing --cov --cov-fail-under=75
Loading

0 comments on commit 051df6b

Please sign in to comment.