Skip to content

build: use uv as pkg manager #143

build: use uv as pkg manager

build: use uv as pkg manager #143

Workflow file for this run

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"]
runs-on: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: |
uv sync
- name: Test
run: |
make gen
make gen-ts
make lint
make test
- name: Codecov
if: matrix.os-version == 'ubuntu-latest'
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"]
runs-on: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: |
uv sync --no-default-groups --group dev
- name: Build
run: |
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"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
- 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"]
pytorch-version: ["2.7.1", "2.1.2", "2.0.0"]
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 PyTorch 2.7.1
if: matrix.pytorch-version == '2.7.1'
run: |
pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1
- name: Install PyTorch 2.1.2
if: matrix.pytorch-version == '2.1.2'
run: |
pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2
- name: Install PyTorch 2.0.0
if: matrix.pytorch-version == '2.0.0'
run: |
pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1
- name: Install dependencies
run: |
pip install numpy==1.26.4
pip install opencv-python==4.10.0.84
cd dist
pip install *.whl
- name: Test pip
run: |
cd scripts
python gen_config.py
python CItestpip.py