feat: support more save format #125
This file contains hidden or 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-test | |
| on: | |
| push: | |
| branches: ["main"] | |
| paths-ignore: | |
| - "**.md" | |
| - "LICENSE" | |
| pull_request: | |
| branches: ["main"] | |
| paths-ignore: | |
| - "**.md" | |
| - "LICENSE" | |
| workflow_dispatch: | |
| env: | |
| GITHUB_ACTIONS: true | |
| jobs: | |
| pytest: | |
| strategy: | |
| matrix: | |
| os-version: ["windows-latest", "ubuntu-latest", "macos-14"] | |
| python-version: ["3.11"] | |
| poetry-version: ["1.8.3"] | |
| runs-on: ${{ matrix.os-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: abatilo/actions-poetry@v3 | |
| with: | |
| poetry-version: ${{ matrix.poetry-version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install numpy==1.26.4 | |
| pip install opencv-python==4.10.0.84 | |
| pip install ccrestoration | |
| pip install PyYAML pydantic loguru | |
| pip install pre-commit scikit-image | |
| pip install pytest pytest-cov coverage | |
| pip install mypy ruff | |
| - name: Install PyTorch on Windows | |
| if: matrix.os-version == 'windows-latest' | |
| run: | | |
| pip install torch==2.7.1 torchvision==0.22.1 --index-url https://download.pytorch.org/whl/cu128 | |
| - name: Install PyTorch on non-Windows | |
| if: matrix.os-version != 'windows-latest' | |
| run: | | |
| pip install torch==2.7.1 torchvision==0.22.1 | |
| - name: Test | |
| run: | | |
| make gen | |
| make gen-ts | |
| make lint | |
| make test | |
| - name: Codecov | |
| if: matrix.os-version == 'ubuntu-20.04' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| build: | |
| strategy: | |
| matrix: | |
| os-version: ["windows-latest", "ubuntu-latest", "macos-14"] | |
| python-version: ["3.11"] | |
| poetry-version: ["1.8.3"] | |
| runs-on: ${{ matrix.os-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: abatilo/actions-poetry@v3 | |
| with: | |
| poetry-version: ${{ matrix.poetry-version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install numpy==1.26.4 | |
| pip install opencv-python==4.10.0.84 | |
| pip install ccrestoration | |
| pip install PyYAML pydantic loguru | |
| - name: Install PyTorch on Windows | |
| if: matrix.os-version == 'windows-latest' | |
| run: | | |
| pip install torch==2.7.1 torchvision==0.22.1 --index-url https://download.pytorch.org/whl/cu128 | |
| - name: Install PyTorch on non-Windows | |
| if: matrix.os-version != 'windows-latest' | |
| run: | | |
| pip install torch==2.7.1 torchvision==0.22.1 | |
| - name: Build | |
| run: | | |
| pip install pyinstaller~=6.14.2 | |
| make gen | |
| make pyinstaller | |
| - name: zip on windows | |
| if: matrix.os-version == 'windows-latest' | |
| run: | | |
| cd dist\Final2x-core | |
| 7z a -r Final2x-core-${{ matrix.os-version }}.7z * | |
| - name: zip on non-windows | |
| if: matrix.os-version != 'windows-latest' | |
| run: | | |
| cd dist/Final2x-core | |
| 7z a -r Final2x-core-${{ matrix.os-version }}.7z * | |
| - name: upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Final2x-core-${{ matrix.os-version }} | |
| path: dist/Final2x-core/*.7z | |
| test-build: | |
| needs: [build] | |
| strategy: | |
| matrix: | |
| os-version: ["windows-latest", "ubuntu-latest", "macos-14"] | |
| runs-on: ${{ matrix.os-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Final2x-core-${{ matrix.os-version }} | |
| path: dist | |
| - name: unzip build # -oXXX is used to specify the output directory, no space after -o | |
| run: | | |
| cd dist | |
| 7z x Final2x-core-${{ matrix.os-version }}.7z -oFinal2x-core | |
| - name: Test build for windows | |
| if: matrix.os-version == 'windows-latest' | |
| run: | | |
| cd dist\Final2x-core | |
| .\Final2x-core | |
| - name: Test build for unix | |
| if: matrix.os-version != 'windows-latest' | |
| run: | | |
| cd dist/Final2x-core | |
| ./Final2x-core | |
| build-wheel: | |
| strategy: | |
| matrix: | |
| python-version: ["3.11"] | |
| poetry-version: ["1.8.3"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: abatilo/actions-poetry@v3 | |
| with: | |
| poetry-version: ${{ matrix.poetry-version }} | |
| - name: Build package | |
| run: | | |
| make build | |
| - name: upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheel | |
| path: dist/*.whl | |
| pip-test: | |
| needs: [build-wheel] | |
| strategy: | |
| matrix: | |
| os-version: ["ubuntu-latest"] | |
| python-version: ["3.11"] | |
| runs-on: ${{ matrix.os-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: wheel | |
| path: dist | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install numpy==1.26.4 | |
| pip install opencv-python==4.10.0.84 | |
| cd dist | |
| pip install *.whl | |
| - name: Install PyTorch on Windows | |
| if: matrix.os-version == 'windows-latest' | |
| run: | | |
| pip install torch==2.7.1 torchvision==0.22.1 --index-url https://download.pytorch.org/whl/cu128 | |
| - name: Install PyTorch on non-Windows | |
| if: matrix.os-version != 'windows-latest' | |
| run: | | |
| pip install torch==2.7.1 torchvision==0.22.1 | |
| - name: Test pip | |
| run: | | |
| cd scripts | |
| python gen_config.py | |
| python CItestpip.py |