Skip to content

Commit 5633122

Browse files
committed
feat: add CI workflows
1 parent b739909 commit 5633122

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Test sysmlv2-python-client
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
paths-ignore:
7+
- '.github/**'
8+
pull_request:
9+
branches: [ main, develop ]
10+
paths-ignore:
11+
- '.github/**'
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
id: setup-python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.11'
26+
27+
- name: Cache pip dependencies
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.cache/pip
31+
key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('pyproject.toml') }}
32+
restore-keys: |
33+
${{ runner.os }}-pip-
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install -e .
39+
pip install pytest pytest-cov requests-mock
40+
41+
- name: Run tests with coverage
42+
run: |
43+
mkdir -p test-results
44+
pytest -v --tb=short \
45+
--junitxml=test-results/results.xml \
46+
--cov=src/sysmlv2_client \
47+
--cov-report=xml:test-results/coverage.xml \
48+
--cov-report=html:test-results/htmlcov
49+
50+
- name: Upload test results
51+
uses: actions/upload-artifact@v4
52+
if: always()
53+
with:
54+
name: test-results-sysmlv2-python-client
55+
path: test-results/

0 commit comments

Comments
 (0)