Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD #1021
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, pull_request] | |
jobs: | |
test: | |
# We're stuck on Ubuntu 20.04 as long as we want to keep testing on Python | |
# 3.6 due to actions/setup-python#544. | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ['3.11', '3.10', '3.9', '3.8', '3.7', '3.6'] | |
cc: [gcc, clang] | |
fail-fast: false | |
env: | |
CC: ${{ matrix.cc }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libelf-dev libdw-dev qemu-kvm zstd ${{ matrix.cc == 'clang' && 'libomp-$(clang --version | sed -rn "s/.*clang version ([0-9]+).*/\\1/p")-dev' || '' }} | |
pip install pyroute2 pre-commit | |
- name: Generate version.py | |
run: python setup.py --version | |
- name: Check with mypy | |
run: pre-commit run --all-files mypy | |
- name: Build and test with ${{ matrix.cc }} | |
run: CONFIGURE_FLAGS="--enable-compiler-warnings=error" python setup.py test -K | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
- name: Install dependencies | |
run: pip install pre-commit | |
- name: Run pre-commit hooks | |
run: SKIP=mypy pre-commit run --all-files --show-diff-on-failure |