-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (82 loc) · 2.77 KB
/
python-tests.yml
File metadata and controls
85 lines (82 loc) · 2.77 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
name: Python Linting, Formatting, Testing, Coverage
on:
pull_request:
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/**'
- 'pyproject.toml'
push:
branches:
- main
- develop
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/**'
- 'pyproject.toml'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up getML
env:
URL_GETML_ENTERPRISE_AMD64: ${{ secrets.URL_GETML_ENTERPRISE_1_5_1_AMD64_LINUX }}
URL_GETML_ENTERPRISE_ARM64: ${{ secrets.URL_GETML_ENTERPRISE_1_5_1_ARM64_LINUX }}
run: |
set -e
set -o pipefail
GETML_INSTALL_DIR="$HOME/.getML"
URL_GETML_ENTERPRISE=""
ARCHITECTURE="${{ runner.arch }}"
if [ "$ARCHITECTURE" == "X64" ]; then
URL_GETML_ENTERPRISE="$URL_GETML_ENTERPRISE_AMD64"
echo "Using AMD64 (X64) getML enterprise URL."
elif [ "$ARCHITECTURE" == "ARM64" ]; then
URL_GETML_ENTERPRISE="$URL_GETML_ENTERPRISE_ARM64"
echo "Using ARM64 getML enterprise URL."
else
echo "Error: Unsupported architecture '$ARCHITECTURE'."
exit 1
fi
if [ -z "$URL_GETML_ENTERPRISE" ]; then
echo "Error: The URL of the getML enterprise for architecture '$ARCHITECTURE' is missing."
exit 1
fi
mkdir -p "$GETML_INSTALL_DIR"
curl -sSL "$URL_GETML_ENTERPRISE" | tar -xzC "$GETML_INSTALL_DIR"
echo "getML installation complete. Contents of '$GETML_INSTALL_DIR':"
ls -la "$GETML_INSTALL_DIR"
- name: Set up Python ${{ matrix.python-version }} and uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
- name: Install dependencies (for Python ${{ matrix.python-version }})
run: |
uv sync \
--python ${{ matrix.python-version }} \
--group development \
--extra-index-url https://europe-west1-python.pkg.dev/getml-infra/wheel/simple
- name: Check linting and formatting
run: |
uv run ruff check --extend-ignore FIX .
uv run ruff format --check .
uv run basedpyright .
- name: Show TODOs
run: |
uv run ruff check --select FIX . || true
- name: Check tests and coverage (for Python ${{ matrix.python-version }})
run: |
uv run pytest \
--cov=./src \
--cov-report=term \
--cov-fail-under=80