Skip to content

Commit d7607e7

Browse files
committed
feature: add CI/CD github workflow configuration
1 parent 93c3b44 commit d7607e7

2 files changed

Lines changed: 123 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
tags: '*.*.*'
6+
release:
7+
types: [ published ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version:
15+
- '3.8'
16+
- '3.9'
17+
- '3.10'
18+
- '3.11'
19+
- '3.12'
20+
- '3.13'
21+
- '3.14'
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
python -m pip install -e . --extra-index-url https://source.md.land/python/
35+
python -m pip install pytest pytest-cov
36+
# pip install -e ".[test]"
37+
38+
- name: Run tests
39+
run: |
40+
# python -m pytest tests/ --cov=lib --cov-report=xml
41+
export PYTHONPATH="$(pwd -P)/lib:$PYTHONPATH"
42+
python -m pytest tests/unit/md/processor/processor.py --cov=lib --cov-report=term
43+
44+
# - name: Upload coverage to Codecov
45+
# uses: codecov/codecov-action@v3
46+
# if: matrix.python-version == '3.10'
47+
# with:
48+
# file: ./coverage.xml
49+
# fail_ci_if_error: true
50+
51+
security:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v3
55+
56+
- name: Set up Python
57+
uses: actions/setup-python@v4
58+
with:
59+
python-version: '3.10'
60+
61+
- name: Install safety
62+
run: pip install safety
63+
64+
- name: Check dependencies for vulnerabilities
65+
run: safety check --full-report
66+
67+
- name: Install bandit
68+
run: pip install bandit
69+
70+
- name: Static security analysis
71+
run: bandit -r lib/ -f json -o bandit-report.json --skip B101
72+
73+
type-check:
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/checkout@v3
77+
78+
- name: Set up Python
79+
uses: actions/setup-python@v4
80+
with:
81+
python-version: '3.10'
82+
83+
- name: Install mypy
84+
run: pip install mypy
85+
86+
- name: Install dependencies
87+
run: pip install -e . --extra-index-url https://source.md.land/python/
88+
89+
- name: Type checking
90+
run: |
91+
export PYTHONPATH="$(pwd -P)/lib:$PYTHONPATH"
92+
mypy lib/ --disable-error-code import-untyped
93+
94+
build:
95+
needs: [test, security, type-check]
96+
runs-on: ubuntu-latest
97+
98+
steps:
99+
- uses: actions/checkout@v3
100+
101+
- name: Set up Python
102+
uses: actions/setup-python@v4
103+
with:
104+
python-version: '3.10'
105+
106+
- name: Install build dependencies
107+
run: pip install build wheel
108+
109+
- name: Build wheel package
110+
run: python -m build --wheel
111+
112+
- name: List artifacts
113+
run: ls -la dist/
114+
115+
- name: Upload wheel to GitHub Releases
116+
uses: svenstaro/upload-release-action@v2
117+
with:
118+
repo_token: ${{ secrets.GITHUB_TOKEN }}
119+
file: dist/*.whl
120+
tag: ${{ github.ref }}
121+
overwrite: true
122+
file_glob: true

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Added
1313

1414
- [x] feature: add generic typing for contracts and base implementation
15+
- [x] feature: add CI/CD github workflow configuration
1516

1617
## [1.0.0] - 2022-05-19
1718

0 commit comments

Comments
 (0)