Skip to content

Commit 11b4c36

Browse files
authored
Merge pull request #5 from PKD667/ci-automation
Add CI automation for tests and benchmarks
2 parents e44e0e4 + 595584c commit 11b4c36

File tree

3 files changed

+73
-1
lines changed

3 files changed

+73
-1
lines changed

.github/workflows/run_benchmarks.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Benchmark Suite
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
run-benchmarks:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
- name: Set up Python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: '3.x'
18+
- name: Install dependencies
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y make gcc
22+
- name: Run benchmark suite
23+
run: make benchmark

.github/workflows/run_tests.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: '3.x'
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install flake8 pytest
23+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
24+
- name: Lint with flake8
25+
run: |
26+
# stop the build if there are Python syntax errors or undefined names
27+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
28+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
29+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
30+
- name: Test with pytest
31+
run: |
32+
pytest
33+
- name: Run CUtils Tests
34+
run: make test

README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,22 @@ The benchmark results are displayed in nanoseconds (ns) and provide an insight i
3636

3737
The repository is configured with GitHub Actions to automatically run the benchmarking suite and update the `README.md` with the latest results upon every push. This ensures that the performance data is always up-to-date.
3838

39+
## Automated Testing and Benchmarking with GitHub Actions
40+
41+
CUtils now leverages GitHub Actions to automatically run the test suite and benchmarking suite upon every push to the repository and on pull requests. This ensures that the code quality and performance are consistently monitored and maintained.
42+
43+
### Test Suite Automation
44+
45+
The test suite is executed automatically using the `make test` command through the GitHub Actions workflow defined in `.github/workflows/run_tests.yml`. This workflow triggers on every push and pull request to the repository.
46+
47+
![Test Workflow Status](https://github.com/PKD667/cutils/actions/workflows/run_tests.yml/badge.svg)
48+
49+
### Benchmark Suite Automation
50+
51+
Similarly, the benchmarking suite is run using the `make benchmark` command via the GitHub Actions workflow found in `.github/workflows/run_benchmarks.yml`. This workflow is triggered on every push to the repository.
52+
53+
![Benchmark Workflow Status](https://github.com/PKD667/cutils/actions/workflows/run_benchmarks.yml/badge.svg)
54+
3955
## Contributing
4056

4157
Contributions to CUtils are welcome. Please submit a pull request or open an issue to discuss proposed changes or additions.
42-

0 commit comments

Comments
 (0)