Updated CI dep #76
Workflow file for this run
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: master | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build-test-cpp: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt update && sudo apt-get install -y wget unzip cmake libgtest-dev clang-format | |
- name: Fetch libtorch # TODO: using a older version since 2.2.2 had some changes to how caffe2::mkl was included. Need to fix | |
run: wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.1.2%2Bcpu.zip && unzip libtorch-cxx11-abi-shared-with-deps-2.1.2+cpu.zip | |
- name: Run format checking | |
run: bash scripts/run_format.sh -c | |
- name: Run tests | |
run: USE_MKLDNN=0 bash scripts/run_cpp_tests.sh | |
linting-code-coverage-python: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install test dependencies | |
run: | | |
python -m pip install -r requirements-dev.txt | |
- name: Running flake8 | |
run: | | |
flake8 . | |
- name: Running isort | |
run: | | |
isort . --check | |
- name: Running black | |
run: | | |
black . --check --line-length=128 | |
- name: Running mypy | |
run: | | |
mypy . | |
- name: Install pytorch | |
run: | | |
python -m pip install torch==2.2.2+cpu -f https://download.pytorch.org/whl/torch_stable.html | |
- name: Code coverage | |
run: | | |
python -m pip install --no-build-isolation -e . | |
pytest --cov=pt_soft_nms --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
test-python: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11'] | |
os: [ubuntu-latest] | |
pytorch-version: ['1.13.1', '2.2.2'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pytorch | |
run: | | |
python -m pip install torch==${{ matrix.pytorch-version }}+cpu -f https://download.pytorch.org/whl/torch_stable.html | |
- name: Install package | |
run: | | |
python -m pip install -r requirements-dev.txt | |
python -m pip install --no-build-isolation . | |
- name: Run unit tests | |
run: | | |
pytest tests/ | |
build-windows: | |
runs-on: "windows-latest" | |
strategy: | |
matrix: | |
python-version: ['3.11'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ilammy/msvc-dev-cmd@v1 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install test dependencies | |
run: | | |
python -m pip install -r requirements-dev.txt | |
- name: Install pytorch | |
run: | | |
python -m pip install torch==2.2.2+cpu -f https://download.pytorch.org/whl/torch_stable.html | |
- name: Install package | |
run: | | |
python -m pip install --no-build-isolation . | |
env: | |
DISTUTILS_USE_SDK: 1 | |
- name: Run unit tests | |
run: pytest tests/ |