Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 24 additions & 28 deletions .github/workflows/CI-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ name: CI-build

on:
push:
branches: [main]
paths-ignore:
- '**.md'
- LICENSE
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- LICENSE
Expand All @@ -16,16 +14,8 @@ on:
permissions:
contents: read

concurrency:
group: ci-build-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
windows:
strategy:
fail-fast: false
matrix:
arch: [x64, arm64]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -37,19 +27,20 @@ jobs:
- uses: pnpm/action-setup@v4

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@v10.0.1
with:
version: 0.11.28
python-version: '3.11'
enable-cache: false

- name: Install dependencies
run: |
pnpm install --frozen-lockfile
pnpm run core:sync:bundle
uv sync --project core --locked --no-default-groups --group dev

- name: Build bundled core
run: pnpm run core:bundle
run: |
make -C core gen
make -C core pyinstaller

- name: Copy bundled core
run: Copy-Item core\dist\Final2x-core resources\Final2x-core -Recurse
Expand All @@ -58,25 +49,29 @@ jobs:
run: resources\Final2x-core\Final2x-core.exe -h

- name: Build desktop app
run: pnpm run build:win-${{ matrix.arch }}
run: pnpm run build:win-x64
env:
GH_TOKEN: ${{ github.token }}

- name: Smoke-test self-contained packaged core
shell: pwsh
run: |
Move-Item core\dist\Final2x-core "$env:RUNNER_TEMP\Final2x-core-build"
Move-Item resources\Final2x-core "$env:RUNNER_TEMP\Final2x-core-staged"
& "dist\win-unpacked\resources\Final2x-core\Final2x-core.exe" -h

- name: Archive unpacked app
shell: pwsh
run: |
$directory = if ('${{ matrix.arch }}' -eq 'x64') { 'dist/win-unpacked' } else { 'dist/win-arm64-unpacked' }
Push-Location $directory
7z a -mx=1 -r "Final2x-windows-${{ matrix.arch }}-unpacked.7z" *
Push-Location dist\win-unpacked
7z a -r "Final2x-windows-x64-unpacked.7z" *
Pop-Location

- name: Upload unpacked app
uses: actions/upload-artifact@v4
with:
name: Final2x-windows-${{ matrix.arch }}-unpacked
path: |
dist/win-unpacked/Final2x-windows-${{ matrix.arch }}-unpacked.7z
dist/win-arm64-unpacked/Final2x-windows-${{ matrix.arch }}-unpacked.7z
name: Final2x-windows-x64-unpacked
path: dist/win-unpacked/Final2x-windows-x64-unpacked.7z

macos:
runs-on: macos-14
Expand All @@ -90,19 +85,20 @@ jobs:
- uses: pnpm/action-setup@v4

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@v10.0.1
with:
version: 0.11.28
python-version: '3.11'
enable-cache: false

- name: Install dependencies
run: |
pnpm install --frozen-lockfile
pnpm run core:sync:bundle
uv sync --project core --locked --no-default-groups --group dev

- name: Build bundled core
run: pnpm run core:bundle
run: |
make -C core gen
make -C core pyinstaller

- name: Copy bundled core
run: cp -R core/dist/Final2x-core resources/
Expand All @@ -124,7 +120,7 @@ jobs:
- name: Archive unpacked app
run: |
cd dist/mac-arm64
7z a -mx=1 -r Final2x-macos-arm64-unpacked.7z ./*
7z a -r Final2x-macos-arm64-unpacked.7z ./*

- name: Upload dmg
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -160,7 +156,7 @@ jobs:
- name: Archive unpacked app
run: |
cd dist/linux-unpacked
7z a -mx=1 -r Final2x-linux-pip-x64-unpacked.7z ./*
7z a -r Final2x-linux-pip-x64-unpacked.7z ./*

- name: Upload packages
uses: actions/upload-artifact@v4
Expand Down
85 changes: 27 additions & 58 deletions .github/workflows/CI-test-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ name: CI-test-core

on:
push:
branches: [main]
paths-ignore:
- '**.md'
- LICENSE
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- LICENSE
Expand All @@ -24,33 +22,27 @@ jobs:
strategy:
matrix:
os-version: [windows-latest, ubuntu-latest, macos-14]
python-version: ['3.11']

runs-on: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- uses: pnpm/action-setup@v4

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@v10.0.1
with:
version: 0.11.28
python-version: ${{ matrix.python-version }}
python-version: '3.11'
enable-cache: false

- name: Install dependencies
run: pnpm run core:sync

- name: Check shared version
run: pnpm run version:check
run: uv sync --project core --locked

- name: Test
run: pnpm run core:check
run: |
make -C core gen
make -C core gen-ts
git diff --exit-code -- src/renderer/src/utils/modelOptions.ts
make -C core lint
make -C core test

- name: Codecov
if: matrix.os-version == 'ubuntu-latest'
Expand All @@ -63,30 +55,24 @@ jobs:
strategy:
matrix:
os-version: [windows-latest, ubuntu-latest, macos-14]
python-version: ['3.11']

runs-on: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- uses: pnpm/action-setup@v4

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@v10.0.1
with:
version: 0.11.28
python-version: ${{ matrix.python-version }}
python-version: '3.11'
enable-cache: false

- name: Install dependencies
run: pnpm run core:sync:bundle
run: uv sync --project core --locked --no-default-groups --group dev

- name: Build
run: pnpm run core:bundle
run: |
make -C core gen
make -C core pyinstaller

- name: Archive on Windows
if: matrix.os-version == 'windows-latest'
Expand Down Expand Up @@ -117,12 +103,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- uses: pnpm/action-setup@v4

- uses: actions/download-artifact@v4
with:
name: Final2x-core-${{ matrix.os-version }}
Expand All @@ -135,36 +115,29 @@ jobs:

- name: Test build on Windows
if: matrix.os-version == 'windows-latest'
run: pnpm run core:test:bundle:windows
run: |
cd core\dist\Final2x-core
.\Final2x-core

- name: Test build on Unix
if: matrix.os-version != 'windows-latest'
run: pnpm run core:test:bundle:unix
run: |
cd core/dist/Final2x-core
./Final2x-core

build-wheel:
strategy:
matrix:
python-version: ['3.11']

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- uses: pnpm/action-setup@v4

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@v10.0.1
with:
version: 0.11.28
python-version: ${{ matrix.python-version }}
python-version: '3.11'
enable-cache: false

- name: Build package
run: pnpm run core:build:wheel
run: uv build core

- name: Upload
uses: actions/upload-artifact@v4
Expand All @@ -184,12 +157,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- uses: pnpm/action-setup@v4

- uses: actions/download-artifact@v4
with:
name: wheel
Expand Down Expand Up @@ -218,4 +185,6 @@ jobs:
pip install core/dist/*.whl

- name: Test pip
run: pnpm run core:test:pip
run: |
python core/scripts/gen_config.py
python core/scripts/CItestpip.py
11 changes: 8 additions & 3 deletions .github/workflows/CI-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ name: CI-test

on:
push:
branches: [main]
paths-ignore:
- '**.md'
- LICENSE
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- LICENSE
Expand All @@ -22,6 +20,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Check shared version
run: python scripts/check_version.py

- uses: actions/setup-node@v4
with:
node-version: 22
Expand All @@ -32,7 +37,7 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm run lint:frontend
run: pnpm run lint

- name: Typecheck
run: pnpm run typecheck
Expand Down
Loading
Loading