Skip to content

Commit 949ea82

Browse files
committed
chore: improved ci testing strategy to reduce build time
1 parent ad405fa commit 949ea82

File tree

4 files changed

+42
-23
lines changed

4 files changed

+42
-23
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
build:
1413

14+
build:
1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
matrix:
@@ -28,11 +28,10 @@ jobs:
2828
python-version: ${{ matrix.python-version }}
2929

3030
- name: Install dependencies
31-
run: |
32-
python3 -m pip install -U pip tox
31+
run: python3 -m pip install -U pip tox
3332

34-
- name: Run Tox
35-
run: tox
33+
- name: Run Tox for Python Tests
34+
run: tox -e py${{ matrix.python-version }}
3635

3736
- name: Generate coverage report
3837
run: |
@@ -50,3 +49,37 @@ jobs:
5049
fail_ci_if_error: true
5150
verbose: true
5251
if: success()
52+
53+
checks:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Check out the code
57+
uses: actions/checkout@v4
58+
59+
- name: Set up Python 3.12
60+
uses: actions/setup-python@v5
61+
with:
62+
python-version: 3.12
63+
64+
- name: Install dependencies
65+
run: python3 -m pip install -U pip tox
66+
67+
- name: Run Linting, Formatting, Security and Type Checks
68+
run: tox -e lint,format,security,type
69+
70+
docs:
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Check out the code
74+
uses: actions/checkout@v4
75+
76+
- name: Set up Python 3.12
77+
uses: actions/setup-python@v5
78+
with:
79+
python-version: 3.12
80+
81+
- name: Install dependencies
82+
run: python3 -m pip install -U pip tox
83+
84+
- name: Build Project Documentation
85+
run: tox -e docs

Makefile

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.DEFAULT_GOAL=help
22

3-
.PHONY: help hello venv install install-dev install-build docs check clean
3+
.PHONY: help hello venv install docs check clean
44

55
VENV_DIR = .venv
66
PYTHON = python3
@@ -22,26 +22,19 @@ help: ## Display this help message with available make commands.
2222
hello: ## Display a welcome message for contributors.
2323
@echo "Your face show, your shoe shine. Thank you for contributing to Fakernaija. E go better for you!"
2424

25-
venv: ## Create a virtual environment for project isolation.
25+
venv: ## Create a virtual environment.
2626
$(PYTHON) -m venv $(VENV_DIR)
2727
@echo "Virtual environment created."
2828
@echo "Activate with the command 'source $(VENV_DIR)/bin/activate'"
2929

30-
install-dev: ## Install local development dependencies.
30+
install: ## Install local development dependencies.
3131
$(call check_venv)
3232
$(PIP) install -U pip setuptools pre-commit tox
3333
$(PIP) install -e .
3434
$(PIP) install -r docs/requirements.txt
3535
$(PRE_COMMIT) install
3636
@echo "Development dependencies installed."
3737

38-
install-build: ## Install project distribution dependencies.
39-
$(call check_venv)
40-
$(PIP) install -U build twine
41-
@echo "Build dependencies installed."
42-
43-
install: install-dev install-build ## Install all dependencies with one command.
44-
4538
docs: ## Generate project HTML documentation using Sphinx.
4639
$(call check_venv)
4740
@rm -rf docs/build

fakernaija/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This package provides utilities to generate random data with a Nigerian context.
44
"""
55

6-
__version__ = "1.0.5"
6+
__version__ = "1.0.6"
77

88
from .naija import Naija
99

tox.ini

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ env_list =
66
lint
77
format
88
security
9-
install
109
docs
1110
py310,py311,py312
1211

@@ -65,12 +64,6 @@ commands =
6564
# B311: Allow pseudo-random generators
6665
bandit --skip B311 -r fakernaija
6766

68-
[testenv:install]
69-
description = Check if the package installs correctly.
70-
skip_install = true
71-
commands =
72-
pip install --no-deps .
73-
7467
[testenv:docs]
7568
description = Build the HTML documentation using Sphinx.
7669
deps =

0 commit comments

Comments
 (0)