Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests for all wheels #746

Draft
wants to merge 51 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
982e9ba
Run tests for all wheels
edenhaus Jan 7, 2025
6e8607a
fix
edenhaus Jan 7, 2025
3a11a16
test
edenhaus Jan 7, 2025
b9acd1f
next try
edenhaus Jan 7, 2025
beca034
next one
edenhaus Jan 7, 2025
42dbe01
fix
edenhaus Jan 7, 2025
3a3bbb6
next try
edenhaus Jan 7, 2025
b622fa4
Fix
edenhaus Jan 7, 2025
482d858
test
edenhaus Jan 7, 2025
bf978b5
next
edenhaus Jan 7, 2025
594da27
next
edenhaus Jan 7, 2025
b80d9c2
test
edenhaus Jan 7, 2025
584f4aa
next
edenhaus Jan 7, 2025
8938f3a
fix
edenhaus Jan 7, 2025
303f810
test
edenhaus Jan 7, 2025
594677a
test
edenhaus Jan 7, 2025
c799373
test
edenhaus Jan 7, 2025
ac12c92
test
edenhaus Jan 7, 2025
f9d2115
test
edenhaus Jan 7, 2025
b309cfa
fix
edenhaus Jan 7, 2025
30f77fe
test
edenhaus Jan 7, 2025
4095f50
fix
edenhaus Jan 7, 2025
e24bf30
test
edenhaus Jan 7, 2025
a3c6796
test
edenhaus Jan 7, 2025
19e3161
test
edenhaus Jan 7, 2025
8a33852
test
edenhaus Jan 7, 2025
9a11004
next
edenhaus Jan 7, 2025
706abf9
test
edenhaus Jan 7, 2025
0c8e216
test
edenhaus Jan 7, 2025
8eb8659
next
edenhaus Jan 7, 2025
25b9d45
n
edenhaus Jan 7, 2025
fd563e8
cache
edenhaus Jan 7, 2025
1951878
test
edenhaus Jan 8, 2025
780a94c
test
edenhaus Jan 8, 2025
be0a82b
test
edenhaus Jan 8, 2025
b59226b
test
edenhaus Jan 8, 2025
75af52b
n
edenhaus Jan 8, 2025
0739447
n
edenhaus Jan 8, 2025
e6abeb4
n
edenhaus Jan 8, 2025
c44d90b
n
edenhaus Jan 8, 2025
00b78b4
n
edenhaus Jan 8, 2025
44c5d5e
n
edenhaus Jan 8, 2025
9712111
n
edenhaus Jan 8, 2025
8d8b93a
n
edenhaus Jan 8, 2025
5e75bfb
n
edenhaus Jan 8, 2025
e39b664
n
edenhaus Jan 8, 2025
d1883b8
n
edenhaus Jan 8, 2025
3306799
n
edenhaus Jan 8, 2025
cb60bf3
n
edenhaus Jan 8, 2025
a89ad11
n
edenhaus Jan 8, 2025
a6c00ba
n
edenhaus Jan 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
270 changes: 213 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,68 +10,224 @@ env:
UV_CACHE_DIR: /tmp/.uv-cache

jobs:
code-quality:
runs-on: "ubuntu-latest"
name: Check code quality
steps:
- name: ⤵️ Checkout repository
uses: actions/checkout@v4
# code-quality:
# runs-on: "ubuntu-latest"
# name: Check code quality
# steps:
# - name: ⤵️ Checkout repository
# uses: actions/checkout@v4

- name: 🏗 Install uv and Python
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
cache-local-path: ${{ env.UV_CACHE_DIR }}

- name: 🏗 Install the project
run: uv sync --locked --dev

# Following steps cannot run by pre-commit.ci as repo = local
- name: Run mypy
run: uv run --frozen mypy deebot_client/

- name: Pylint review
run: uv run --frozen pylint deebot_client/**/*.py

- name: Verify no getLogger usages
run: scripts/check_getLogger.sh

tests:
runs-on: "ubuntu-latest"
name: Run tests
strategy:
matrix:
python-version:
- "3.12"
- "3.13"
steps:
- name: ⤵️ Checkout repository
uses: actions/checkout@v4
# - name: 🏗 Install uv and Python
# uses: astral-sh/setup-uv@v5
# with:
# enable-cache: true
# cache-dependency-glob: "uv.lock"
# cache-local-path: ${{ env.UV_CACHE_DIR }}

- name: 🏗 Install uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
cache-local-path: ${{ env.UV_CACHE_DIR }}
python-version: ${{ matrix.python-version }}
# - name: 🏗 Install the project
# run: uv sync --locked --dev

- name: 🏗 Install the project
run: uv sync --locked --dev
# # Following steps cannot run by pre-commit.ci as repo = local
# - name: Run mypy
# run: uv run --frozen mypy deebot_client/

- name: Run pytest
run: uv run --frozen pytest tests --cov=./ --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
# - name: Pylint review
# run: uv run --frozen pylint deebot_client/**/*.py

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
# - name: Verify no getLogger usages
# run: scripts/check_getLogger.sh

armv7_job:
# The host should always be Linux
runs-on: ubuntu-22.04
name: Build on ubuntu-22.04 armv7
steps:
- uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2
name: Run commands
id: runcmd
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
arch: none
distro: none
base_image: "--platform=linux/arm/v7 python:alpine"

# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
# githubToken: ${{ github.token }}

# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
install: |
set -euxo pipefail
apk add --no-cache xz-dev
wget -qO- https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
# Set an output parameter `uname` for use in subsequent steps
run: |
set -euxo pipefail
source $HOME/.local/bin/env
uv sync --frozen --dev
uv build --wheel
rm -rf deebot_client*
uv pip install --force-reinstall dist/*
pytest tests --cov=./ --cov-report=xml --junitxml=junit.xml -o junit_family=legacy

# test:
# runs-on: "ubuntu-latest"
# steps:
# - name: ⤵️ Checkout repository
# uses: actions/checkout@v4

# - name: Build for Alpine targets
# uses: addnab/docker-run-action@v3
# with:
# image: ghcr.io/astral-sh/uv:alpine
# run: |
# apk add --no-cache xz-dev
# uv venv -p 3.13
# ls -al
# uv build --wheel
# rm -rf deebot_client*
# uv sync --locked --only-dev
# uv pip install --force-reinstall dist/*
# pytest tests --cov=./ --cov-report=xml --junitxml=junit.xml -o junit_family=legacy

# wheels:
# name: Py${{ matrix.python-version }} on ${{ matrix.config.platform }} with ${{ matrix.config.manylinux }}
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# config:
# # - platform: "x86_64"
# # manylinux: "musllinux_1_2"
# # before-script: "sudo apt update && sudo apt install -y pkg-config liblzma-dev"
# - platform: "x86_64"
# manylinux: "manylinux_2_28"
# before-script: "yum install -y xz-devel"
# - platform: "armv7"
# manylinux: "manylinux_2_28"
# before-script: "sudo apt update && sudo apt install -y pkg-config liblzma-dev"
# - platform: "aarch64"
# manylinux: "manylinux_2_28"
# before-script: "sudo apt update && sudo apt install -y pkg-config liblzma-dev"
# python-version:
# - "3.12"
# - "3.13"
# steps:
# - name: ⤵️ Check out code from GitHub
# uses: actions/[email protected]
# - name: 🏗 Set up uv and Python ${{ matrix.python-version }}
# uses: astral-sh/setup-uv@v5
# with:
# enable-cache: true
# python-version: ${{ matrix.python-version }}
# - name: 🏗 Set package version
# if: ${{ github.event_name == 'release' }}
# run: |
# sed -i "s/^version = \".*\"/version = \"${{ github.event.release.tag_name }}\"/" pyproject.toml
# - name: 🏗 Prepare for build
# run: |
# uv sync --locked --only-dev
# python3 -m ensurepip
# - name: Cache Docker images.
# uses: ScribeMD/[email protected]
# with:
# key: docker-${{ runner.os }}-${{ matrix.config.platform }}-${{ matrix.config.manylinux }}
# - name: 📦 Build wheel
# uses: PyO3/maturin-action@v1
# id: build
# with:
# target: ${{ matrix.config.platform }}
# args: --release --out dist -i ${{ matrix.python-version}}
# manylinux: ${{ matrix.config.manylinux }}
# before-script-linux: ${{ matrix.config.before-script }}
# - name: ⬆️ Upload wheel
# uses: actions/upload-artifact@v4
# with:
# name: wheels-${{ matrix.python-version }}-${{ matrix.config.manylinux }}-${{ matrix.config.platform }}
# path: dist
# - name: Remove sources to avoid conflicts during tests
# run: |
# rm -rf deebot_client*
# - name: pytest
# if: ${{ startsWith(matrix.config.manylinux, 'manylinux') && matrix.config.platform == 'x86_64' }}
# shell: bash
# run: |
# set -e
# uv pip install --force-reinstall dist/*
# pytest tests --cov=./ --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
# - name: pytest
# if: ${{ startsWith(matrix.config.manylinux, 'manylinux') && matrix.config.platform != 'x86_64' }}
# uses: uraimo/run-on-arch-action@v2
# with:
# arch: ${{ matrix.config.platform }}
# distro: ubuntu_latest
# githubToken: ${{ github.token }}
# install: |
# curl -LsSf https://astral.sh/uv/install.sh | sh
# uv sync --locked --only-dev
# run: |
# set -e
# uv pip install --force-reinstall dist/*
# pytest tests --cov=./ --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
# - name: pytest
# if: ${{ startsWith(matrix.config.manylinux, 'musllinux') && matrix.config.platform == 'x86_64' }}
# uses: addnab/docker-run-action@v3
# with:
# image: alpine:latest
# options: -v ${{ github.workspace }}:/io -w /io
# run: |
# set -e
# curl -LsSf https://astral.sh/uv/install.sh | sh
# uv sync --locked --only-dev
# uv pip install --force-reinstall dist/*
# pytest tests --cov=./ --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
# - name: pytest
# if: ${{ startsWith(matrix.config.manylinux, 'musllinux') && matrix.config.platform != 'x86_64' }}
# uses: uraimo/run-on-arch-action@v2
# with:
# arch: ${{ matrix.config.platform }}
# distro: alpine_latest
# githubToken: ${{ github.token }}
# install: |
# curl -LsSf https://astral.sh/uv/install.sh | sh
# uv sync --locked --only-dev
# run: |
# set -e
# uv pip install --force-reinstall dist/*
# pytest tests --cov=./ --cov-report=xml --junitxml=junit.xml -o junit_family=legacy

# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v5
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: true

# - name: Upload test results to Codecov
# if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
# uses: codecov/test-results-action@v1
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: true

sdist:
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
name: wheels-sdist
path: dist
88 changes: 67 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,75 @@
__pycache__
Pipfile
Pipfile.lock
scratch*
.idea
build
dist
venv

# Nosetests files
cover/
.coverage
target/

# Byte-compiled / optimized / DLL files
__pycache__/
.pytest_cache/
*.py[cod]

# Ignore Vscode files
.vscode
# C extensions
*.so

# Distribution / packaging
.Python
.venv/
env/
bin/
build/
develop-eggs/
dist/
eggs/
lib/
lib64/
parts/
sdist/
var/
include/
man/
venv/
*.egg-info/
.noseids
.installed.cfg
*.egg

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
pip-selfcheck.json

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

.*_cache
# Translations
*.mo

test.py
.env
# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Rope
.ropeproject

/target
# Django stuff:
*.log
*.pot

# rust so
*.cpython*.so
.DS_Store

# Sphinx documentation
docs/_build/

# PyCharm
.idea/

# VSCode
.vscode/

# Pyenv
.python-version

test.py
.env
Loading