-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (58 loc) · 2.24 KB
/
Copy pathpython-package.yml
File metadata and controls
69 lines (58 loc) · 2.24 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
name: iLibrary
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14"]
# 1. Inject SECRETS as Environment Variables for the entire job
env:
DB_HOST: ${{ secrets.DB_SYSTEM }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_LIB: ${{ secrets.DB_LIB }}
DB_REMPATH: ${{ secrets.DB_REMPATH }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# 2. Install IBM i Access ODBC Driver
# This block is CRITICAL for cross-platform DB testing
- name: Install IBM i Access ODBC Driver
run: |
# Install unixODBC driver manager dependencies
sudo apt-get update
sudo apt-get install -y unixodbc unixodbc-dev
# Add the official IBM i ODBC repository
curl https://public.dhe.ibm.com/software/ibmi/products/odbc/debs/dists/1.1.0/ibmi-acs-1.1.0.list | sudo tee /etc/apt/sources.list.d/ibmi-acs.list
# Update and install the IBM i Access package
sudo apt update
sudo apt install -y ibm-iaccess
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
# pyodbc is needed for the IBM i connection
python -m pip install -r requirements.txt
python -m pip install -e .
python -m pip install flake8 pytest # Ensure testing/linting tools are installed
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# 3. Test with pytest
# Tests will connect using the injected secrets and the installed ODBC driver
- name: Test with pytest
run: |
pytest app/iLibrary/tests