Skip to content

Commit c061c85

Browse files
Copilotmichaelchu
andauthored
Add CI workflow for format checking and test execution (#71)
* Initial plan * Add CI workflow to check formatting and run tests Co-authored-by: michaelchu <540510+michaelchu@users.noreply.github.com> * Add CI status badge to README Co-authored-by: michaelchu <540510+michaelchu@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: michaelchu <540510+michaelchu@users.noreply.github.com>
1 parent 31bfd1c commit c061c85

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master, develop ]
6+
pull_request:
7+
branches: [ main, master, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -e .
30+
pip install pytest black
31+
32+
- name: Check code formatting with black
33+
run: |
34+
black --check optopsy/ tests/ setup.py
35+
36+
- name: Run tests with pytest
37+
run: |
38+
pytest tests/ -v

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[![CI](https://github.com/michaelchu/optopsy/actions/workflows/ci.yml/badge.svg)](https://github.com/michaelchu/optopsy/actions/workflows/ci.yml)
12
[![Downloads](https://pepy.tech/badge/optopsy)](https://pepy.tech/project/optopsy)
23
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
34

0 commit comments

Comments
 (0)