From e8d27f8d3d71606f1af51f1934f6fd3adf068af7 Mon Sep 17 00:00:00 2001 From: ControlNet Date: Sat, 10 Feb 2024 01:40:51 +1100 Subject: [PATCH] add ci for dep check --- .github/workflows/dependency_test.yaml | 184 +++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 .github/workflows/dependency_test.yaml diff --git a/.github/workflows/dependency_test.yaml b/.github/workflows/dependency_test.yaml new file mode 100644 index 0000000..3649c4b --- /dev/null +++ b/.github/workflows/dependency_test.yaml @@ -0,0 +1,184 @@ +name: Dependency Test +on: + push: + branches-ignore: + - "master" + pull_request: + +jobs: + lib-import-test: + name: Lib Dependency Test + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + torch-version: ["1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "1.13.*", "2.0.*", "2.1.*"] + include: + - torch-version: "1.8.*" + torchvision-version: "0.9.*" + - torch-version: "1.9.*" + torchvision-version: "0.10.*" + - torch-version: "1.10.*" + torchvision-version: "0.11.*" + - torch-version: "1.11.*" + torchvision-version: "0.12.*" + - torch-version: "1.12.*" + torchvision-version: "0.13.*" + - torch-version: "1.13.*" + torchvision-version: "0.14.*" + - torch-version: "2.0.*" + torchvision-version: "0.15.*" + - torch-version: "2.1.*" + torchvision-version: "0.16.*" + exclude: + - python-version: "3.6" + torch-version: "1.11.*" + - python-version: "3.6" + torch-version: "1.12.*" + - python-version: "3.6" + torch-version: "1.13.*" + - python-version: "3.6" + torch-version: "2.0.*" + - python-version: "3.6" + torch-version: "2.1.*" + + - python-version: "3.7" + torch-version: "2.0.*" + - python-version: "3.7" + torch-version: "2.1.*" + + - python-version: "3.10" + torch-version: "1.8.*" + - python-version: "3.10" + torch-version: "1.9.*" + - python-version: "3.10" + torch-version: "1.10.*" + + - python-version: "3.11" + torch-version: "1.8.*" + - python-version: "3.11" + torch-version: "1.9.*" + - python-version: "3.11" + torch-version: "1.10.*" + - python-version: "3.11" + torch-version: "1.11.*" + - python-version: "3.11" + torch-version: "1.12.*" + - python-version: "3.11" + torch-version: "1.13.*" + + steps: + - uses: actions/checkout@v3 + + - name: Set Swap Space + uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 10 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + + - name: Install PyAV Dependencies for Python 3.6 + if: matrix.python-version == '3.6' + run: | + sudo apt install -y libavformat-dev libavdevice-dev + pip install "av==6.*" + + - name: Install dependencies + run: | + sudo apt install -y ffmpeg wget + pip install torch==${{ matrix.torch-version }} + pip install torchvision==${{ matrix.torchvision-version }} + pip install -r requirements.lib.txt + python init.py + + - name: Set PYTHONPATH + run: echo "PYTHONPATH=$(pwd)/src" >> $GITHUB_ENV + + - name: Run Import Test + run: python -c "from marlin_pytorch import Marlin" + + script-import-test: + name: Script Dependency Test + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + torch-version: ["1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "1.13.*", "2.0.*", "2.1.*"] + include: + - torch-version: "1.8.*" + torchvision-version: "0.9.*" + - torch-version: "1.9.*" + torchvision-version: "0.10.*" + - torch-version: "1.10.*" + torchvision-version: "0.11.*" + - torch-version: "1.11.*" + torchvision-version: "0.12.*" + - torch-version: "1.12.*" + torchvision-version: "0.13.*" + - torch-version: "1.13.*" + torchvision-version: "0.14.*" + - torch-version: "2.0.*" + torchvision-version: "0.15.*" + - torch-version: "2.1.*" + torchvision-version: "0.16.*" + exclude: + - python-version: "3.7" + torch-version: "2.0.*" + - python-version: "3.7" + torch-version: "2.1.*" + + - python-version: "3.10" + torch-version: "1.8.*" + - python-version: "3.10" + torch-version: "1.9.*" + - python-version: "3.10" + torch-version: "1.10.*" + + - python-version: "3.11" + torch-version: "1.8.*" + - python-version: "3.11" + torch-version: "1.9.*" + - python-version: "3.11" + torch-version: "1.10.*" + - python-version: "3.11" + torch-version: "1.11.*" + - python-version: "3.11" + torch-version: "1.12.*" + - python-version: "3.11" + torch-version: "1.13.*" + + steps: + - uses: actions/checkout@v3 + + - name: Set Swap Space + uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 10 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + + - name: Install dependencies + run: | + sudo apt install -y ffmpeg wget + pip install torch==${{ matrix.torch-version }} + pip install torchvision==${{ matrix.torchvision-version }} + pip install -r requirements.txt + python init.py + + - name: Set PYTHONPATH + run: echo "PYTHONPATH=$(pwd)/src" >> $GITHUB_ENV + + - name: Run Import Test + run: | + python -c "from train import *" + python -c "from evaluate import *"