-
Notifications
You must be signed in to change notification settings - Fork 7
111 lines (90 loc) · 2.9 KB
/
Copy pathci.yml
File metadata and controls
111 lines (90 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: CI Tests
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
jobs:
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Run linting
run: |
pylint ibm_secrets_manager_sdk --rcfile=.pylintrc || true
- name: Run unit tests
run: |
pytest test/unit/ -v --tb=short
- name: Run integration tests
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
SECRETS_MANAGER_URL: ${{ secrets.SECRETS_MANAGER_URL }}
SECRETS_MANAGER_APIKEY: ${{ secrets.SECRETS_MANAGER_APIKEY }}
run: |
pytest test/integration/ -v --tb=short || echo "Integration tests skipped or failed"
lint:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python 3.9
uses: actions/setup-python@v6
with:
python-version: 3.9
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Check code formatting
run: |
pip install black
black --check ibm_secrets_manager_sdk/ test/ || echo "Code formatting check completed"
- name: Run pylint
run: |
pylint ibm_secrets_manager_sdk --rcfile=.pylintrc --exit-zero
build:
name: Build Distribution
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python 3.9
uses: actions/setup-python@v6
with:
python-version: 3.9
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "setuptools<82" build wheel
- name: Build distribution
run: |
python -m build --no-isolation --sdist --wheel --outdir dist/ .
- name: Check distribution
run: |
pip install twine
twine check dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
retention-days: 7