|
| 1 | +name: Unittest |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches-ignore: |
| 5 | + - "master" |
| 6 | + pull_request: |
| 7 | + |
| 8 | +jobs: |
| 9 | + unittest: |
| 10 | + name: Unittest |
| 11 | + |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] |
| 16 | + torch-version: ["1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "1.13.*"] |
| 17 | + include: |
| 18 | + - torch-version: "1.8.*" |
| 19 | + torchvision-version: "0.9.*" |
| 20 | + - torch-version: "1.9.*" |
| 21 | + torchvision-version: "0.10.*" |
| 22 | + - torch-version: "1.10.*" |
| 23 | + torchvision-version: "0.11.*" |
| 24 | + - torch-version: "1.11.*" |
| 25 | + torchvision-version: "0.12.*" |
| 26 | + - torch-version: "1.12.*" |
| 27 | + torchvision-version: "0.13.*" |
| 28 | + - torch-version: "1.13.*" |
| 29 | + torchvision-version: "0.14.*" |
| 30 | + exclude: |
| 31 | + - python-version: "3.6" |
| 32 | + torch-version: "1.11.*" |
| 33 | + - python-version: "3.6" |
| 34 | + torch-version: "1.12.*" |
| 35 | + - python-version: "3.6" |
| 36 | + torch-version: "1.13.*" |
| 37 | + - python-version: "3.10" |
| 38 | + torch-version: "1.8.*" |
| 39 | + - python-version: "3.10" |
| 40 | + torch-version: "1.9.*" |
| 41 | + - python-version: "3.10" |
| 42 | + torch-version: "1.10.*" |
| 43 | + |
| 44 | + runs-on: ubuntu-20.04 |
| 45 | + |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v3 |
| 48 | + |
| 49 | + - name: Set Swap Space |
| 50 | + uses: pierotofy/set-swap-space@master |
| 51 | + with: |
| 52 | + swap-size-gb: 10 |
| 53 | + |
| 54 | + - name: Set up Python |
| 55 | + uses: actions/setup-python@v4 |
| 56 | + with: |
| 57 | + python-version: ${{ matrix.python-version }} |
| 58 | + architecture: x64 |
| 59 | + |
| 60 | + - name: Install PyAV Dependencies for Python 3.6 |
| 61 | + if: matrix.python-version == '3.6' |
| 62 | + run: | |
| 63 | + sudo apt install -y libavformat-dev libavdevice-dev |
| 64 | +
|
| 65 | + - name: Install dependencies |
| 66 | + run: | |
| 67 | + sudo apt install -y ffmpeg wget |
| 68 | + pip install torch==${{ matrix.torch-version }} |
| 69 | + pip install torchvision==${{ matrix.torchvision-version }} |
| 70 | + pip install -r requirements.lib.txt |
| 71 | + python init.py |
| 72 | +
|
| 73 | + - name: Download model checkpoints |
| 74 | + run: | |
| 75 | + mkdir test/model |
| 76 | + wget -O test/model/marlin_vit_base_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_base_ytf.encoder.pt |
| 77 | + wget -O test/model/marlin_vit_base_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_base_ytf.full.pt |
| 78 | + wget -O test/model/marlin_vit_small_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_small_ytf.encoder.pt |
| 79 | + wget -O test/model/marlin_vit_small_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_small_ytf.full.pt |
| 80 | + wget -O test/model/marlin_vit_large_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_large_ytf.encoder.pt |
| 81 | + wget -O test/model/marlin_vit_large_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_large_ytf.full.pt |
| 82 | +
|
| 83 | + - name: Set PYTHONPATH |
| 84 | + run: echo "PYTHONPATH=$(pwd)/src" >> $GITHUB_ENV |
| 85 | + |
| 86 | + - name: Run Test |
| 87 | + run: | # python -m unittest discover test |
| 88 | + python -m unittest test/test_version.py |
| 89 | + python -m unittest test/test_marlin_vit_base.py |
| 90 | + python -m unittest test/test_marlin_vit_small.py |
| 91 | + python -m unittest test/test_marlin_vit_large.py |
| 92 | +
|
| 93 | + coverage: |
| 94 | + # Run coverage and report to coveralls |
| 95 | + name: Coverage |
| 96 | + needs: [unittest] |
| 97 | + runs-on: ubuntu-20.04 |
| 98 | + |
| 99 | + steps: |
| 100 | + - uses: actions/checkout@v2 |
| 101 | + |
| 102 | + - name: Set up Python |
| 103 | + uses: actions/setup-python@v2 |
| 104 | + with: |
| 105 | + python-version: "3.10" |
| 106 | + architecture: x64 |
| 107 | + |
| 108 | + - name: Install dependencies |
| 109 | + run: | |
| 110 | + sudo apt install -y ffmpeg wget |
| 111 | + pip install torch=="1.13.*" |
| 112 | + pip install torchvision=="0.14.*" |
| 113 | + pip install -r requirements.lib.txt |
| 114 | + python init.py |
| 115 | + pip install coverage pytest coveralls |
| 116 | +
|
| 117 | + - name: Download model checkpoints |
| 118 | + run: | |
| 119 | + mkdir test/model |
| 120 | + wget -O test/model/marlin_vit_base_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_base_ytf.encoder.pt |
| 121 | + wget -O test/model/marlin_vit_base_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_base_ytf.full.pt |
| 122 | + wget -O test/model/marlin_vit_small_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_small_ytf.encoder.pt |
| 123 | + wget -O test/model/marlin_vit_small_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_small_ytf.full.pt |
| 124 | + wget -O test/model/marlin_vit_large_ytf.encoder.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_large_ytf.encoder.pt |
| 125 | + wget -O test/model/marlin_vit_large_ytf.full.pt https://github.com/ControlNet/MARLIN/releases/download/model_v1/marlin_vit_large_ytf.full.pt |
| 126 | +
|
| 127 | + - name: Set PYTHONPATH |
| 128 | + run: echo "PYTHONPATH=$(pwd)/src" >> $GITHUB_ENV |
| 129 | + |
| 130 | + - name: Run Coverage |
| 131 | + run: coverage run --source=marlin_pytorch -m unittest discover |
| 132 | + |
| 133 | + - name: Coveralls |
| 134 | + run: coveralls --service=github |
| 135 | + env: |
| 136 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 137 | + COVERALLS_FLAG_NAME: marlin_pytorch |
| 138 | + COVERALLS_PARALLEL: true |
| 139 | + |
| 140 | + coveralls_finish: |
| 141 | + name: Coveralls Finish |
| 142 | + needs: [coverage] |
| 143 | + runs-on: ubuntu-20.04 |
| 144 | + container: python:3-slim |
| 145 | + |
| 146 | + steps: |
| 147 | + - name: Finished |
| 148 | + run: | |
| 149 | + pip3 install --upgrade coveralls |
| 150 | + coveralls --service=github --finish |
| 151 | + env: |
| 152 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments