Skip to content

Commit 4c720cc

Browse files
author
Administrator
committed
ci: add GitHub Actions workflow for automated testing
- Run tests on Python 3.11 and 3.12 - Check code quality with ruff and black - Upload coverage to Codecov - Build and upload distribution artifacts
1 parent 4703aa1 commit 4c720cc

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.11', '3.12']
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -e ".[test]"
28+
29+
- name: Run linters
30+
run: |
31+
pip install ruff black mypy
32+
ruff check .
33+
black --check .
34+
35+
- name: Run unit tests
36+
run: |
37+
pytest tests/unit -v --cov=amazon_ads_api --cov-report=xml
38+
39+
- name: Upload coverage
40+
uses: codecov/codecov-action@v4
41+
with:
42+
files: ./coverage.xml
43+
flags: unittests
44+
name: codecov-umbrella
45+
46+
build:
47+
runs-on: ubuntu-latest
48+
needs: test
49+
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- name: Set up Python
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: '3.11'
57+
58+
- name: Build package
59+
run: |
60+
pip install build
61+
python -m build
62+
63+
- name: Upload artifacts
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: dist
67+
path: dist/
68+

0 commit comments

Comments
 (0)