Skip to content

WIP: Improve AliBuild typing and linter strictness #630

WIP: Improve AliBuild typing and linter strictness

WIP: Improve AliBuild typing and linter strictness #630

Workflow file for this run

---
# This workflow will install Python dependencies, run tests and lint with a
# variety of Python versions. For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Check PR
'on':
push:
branches:
- master
pull_request:
branches:
- master
permissions: {}
jobs:
unittest:
name: python${{ matrix.python-version }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false # continue executing other checks if one fails
matrix:
python-version:
- '3.6.8' # slc7, slc8 and cs8 containers
- '3.8.10' # ubuntu2004 container
- '3.9.16' # slc9 container
- '3.10.6' # ubuntu2204 container
- '3.11'
- '3.12'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
sudo apt update -y
sudo apt install -y curl libcurl4-gnutls-dev build-essential gfortran libmysqlclient-dev xorg-dev libglu1-mesa-dev libfftw3-dev libxml2-dev git unzip autoconf automake autopoint texinfo gettext libtool libtool-bin pkg-config bison flex libperl-dev libbz2-dev swig liblzma-dev libnanomsg-dev rsync lsb-release unzip environment-modules libglfw3-dev libtbb-dev python3-venv libncurses-dev environment-modules libxml2-dev libxslt1-dev
python -m pip install --upgrade tox tox-gh-actions coverage
- name: Run tests
run: tox
- name: Convert coverage information
if: ${{ always() && github.event.repository.owner.login == 'alisw' }}
run: |
coverage combine .tox/coverage.*
# Codecov only understands XML, JSON and LCOV files.
# Apparently, patching os.readlink in unit tests interferes with
# finding some source files, but our source shouldn't be affected, so
# ignore these errors.
coverage json --ignore-errors -o coverage.json
- name: Upload coverage information
if: ${{ always() && github.event.repository.owner.login == 'alisw' }}
uses: codecov/codecov-action@v3
with:
files: coverage.json
mac-unittest:
name: mac-python${{ matrix.python-version }}
runs-on: macos-latest
strategy:
fail-fast: false # continue executing other checks if one fails
matrix:
python-version:
- '3.11'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
brew install modules alisw/system-deps/o2-full-deps sapling
python3 -m pip install --upgrade tox tox-gh-actions coverage
- name: Run tests
run: tox -e darwin
- name: Convert coverage information
if: ${{ always() && github.event.repository.owner.login == 'alisw' }}
run: |
coverage combine .tox/coverage.*
# Codecov only understands XML, JSON and LCOV files.
# Apparently, patching os.readlink in unit tests interferes with
# finding some source files, but our source shouldn't be affected, so
# ignore these errors.
coverage json --ignore-errors -o coverage.json
- name: Upload coverage information
if: ${{ always() && github.event.repository.owner.login == 'alisw' }}
uses: codecov/codecov-action@v3
with:
files: coverage.json
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: python -m pip install --upgrade tox tox-gh-actions
- name: Run linters
run: tox -e lint