CI: unique name for tox artifacts #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
# on every branch | |
branches: | |
- '*' | |
env: | |
PIP_CACHE_DIR: ${{ github.workspace }}/.cache/pip | |
QT_DEBUG_PLUGINS: 1 | |
QT_QPA_PLATFORM: offscreen | |
jobs: | |
static_analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: pip install -r requirements_dev.txt | |
- name: Run pre-commit | |
run: | | |
pip install pre-commit | |
pre-commit run --all-files | |
continue-on-error: true | |
- name: Upload pre-commit report | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pre-commit-report | |
path: pre-commit-report | |
test: | |
runs-on: ubuntu-latest | |
env: | |
NUMBA_DISABLE_JIT : 1 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: pip install -r requirements_dev.txt | |
- name: Install project | |
run: pip install -e . | |
- name: Set up xvfb | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y xvfb | |
sleep 3 | |
- name: Run tests with coverage | |
run: | | |
xvfb-run py.test -s --cov=lbfgsb --cov-report xml --cov-report html --cov-report term --cov-config=.coveragerc --color=yes | |
continue-on-error: false | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
tox: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 10 | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install tox | |
run: python3 -m pip install tox | |
- name: Set up xvfb | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y xvfb | |
sleep 3 | |
- name: Run tox | |
run: xvfb-run tox | |
- name: Upload distribution artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ubuntu-python-package-${{matrix.os}}-${{matrix.python.py}} | |
path: dist/*.whl |