Skip to content

Commit

Permalink
テストを分ける
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Jan 29, 2025
1 parent 86a0bb1 commit cb6f6be
Showing 1 changed file with 71 additions and 48 deletions.
119 changes: 71 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,21 @@ jobs:
name: sora_sdk
path: sora_sdk/

build_linux_macos:
build_ubuntu:
strategy:
fail-fast: false
matrix:
platform:
# - name: ubuntu-24.04_x86_64
# target: ubuntu-24.04_x86_64
# runs_on: ubuntu-24.04
# os: ubuntu
- name: ubuntu-24.04_x86_64
target: ubuntu-24.04_x86_64
runs_on: ubuntu-24.04
os: ubuntu
arch: x86_64
- name: ubuntu-22.04_x86_64
target: ubuntu-22.04_x86_64
runs_on: ubuntu-22.04
os: ubuntu
arch: x86_64
- name: macos-15_arm64
target: macos_arm64
runs_on: macos-15
os: macos
python_host_platform: "macosx-15.0-arm64"
archflags: "-arch arm64"
- name: macos-14_arm64
target: macos_arm64
runs_on: macos-14
os: macos
python_host_platform: "macosx-14.0-arm64"
archflags: "-arch arm64"
python_version:
- "3.10"
- "3.11"
Expand All @@ -99,11 +88,10 @@ jobs:
cp sora_sdk/py.typed src/sora_sdk/py.typed
cp sora_sdk/sora_sdk_ext.pyi src/sora_sdk/sora_sdk_ext.pyi
# libx11-dev は Ubuntu 24.04 の時に必要になる
- if: ${{ matrix.platform.os == 'ubuntu'}}
run: |
- run: |
sudo apt-get update
sudo apt-get -y install libx11-dev
- if: ${{ matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'armv8' }}
- if: ${{ matrix.platform.arch == 'armv8' }}
run: |
sudo apt-get -y install multistrap binutils-aarch64-linux-gnu
# multistrap に insecure なリポジトリからの取得を許可する設定を入れる
Expand All @@ -115,48 +103,27 @@ jobs:
- run: uv sync

# Ubuntu x86_64 向け
- if: ${{ matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'x86_64' }}
- if: ${{ matrix.platform.arch == 'x86_64' }}
name: Tailscale
uses: tailscale/github-action@v3
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci

- if: ${{ matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'x86_64' }}
- if: ${{ matrix.platform.arch == 'x86_64' }}
run: |
uv run python run.py ${{ matrix.platform.target }}
uv run python -m build
# Ubuntu armv8 向け
- if: ${{ matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'armv8' }}
# Ubuntu 24.04 armv8 向けクロスビルド
- if: ${{ matrix.platform.arch == 'armv8' }}
run: |
uv run python run.py ${{ matrix.platform.target }}
uv run python -m build
env:
SORA_SDK_TARGET: ${{ matrix.platform.target }}

# Ubuntu 向けに Python 3.10 では E2E テストを実行する
- if: ${{ matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'x86_64' && matrix.python_version == '3.10' }}
name: Download openh264
run: |
curl -LO http://ciscobinary.openh264.org/libopenh264-2.4.1-linux64.7.so.bz2
bzip2 -d libopenh264-2.4.1-linux64.7.so.bz2
mv libopenh264-2.4.1-linux64.7.so libopenh264.so
echo "OPENH264_PATH=$(pwd)/libopenh264.so" >> $GITHUB_ENV
- if: ${{ matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'x86_64' && matrix.python_version == '3.10' }}
run: uv run pytest tests -s


# macOS 向け
- if: ${{ matrix.platform.os == 'macos' }}
run: |
uv run python run.py ${{ matrix.platform.target }}
uv run python -m build
env:
_PYTHON_HOST_PLATFORM: ${{ matrix.platform.python_host_platform }}
ARCHFLAGS: ${{ matrix.platform.archflags }}

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -213,6 +180,60 @@ jobs:
env:
SORA_SDK_TARGET: ${{ matrix.platform.target }}
build_macos:
strategy:
fail-fast: false
matrix:
platform:
- name: macos-15_arm64
target: macos_arm64
runs_on: macos-15
os: macos
python_host_platform: "macosx-15.0-arm64"
archflags: "-arch arm64"
- name: macos-14_arm64
target: macos_arm64
runs_on: macos-14
os: macos
python_host_platform: "macosx-14.0-arm64"
archflags: "-arch arm64"
python_version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
needs: [build_pyi]
runs-on: ${{ matrix.platform.runs_on }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: sora_sdk
path: sora_sdk/
- run: |
cp sora_sdk/py.typed src/sora_sdk/py.typed
cp sora_sdk/sora_sdk_ext.pyi src/sora_sdk/sora_sdk_ext.pyi
- uses: astral-sh/setup-uv@v5
with:
enable-cache: false
- run: uv python pin ${{ matrix.python_version }}
- run: uv sync

- run: |
uv run python run.py ${{ matrix.platform.target }}
uv run python -m build
env:
_PYTHON_HOST_PLATFORM: ${{ matrix.platform.python_host_platform }}
ARCHFLAGS: ${{ matrix.platform.archflags }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.name }}_python-${{ matrix.python_version }}
path: "dist/"


build_windows:
needs: [build_pyi]
runs-on: windows-2022
Expand Down Expand Up @@ -264,7 +285,7 @@ jobs:
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

slack_notify_failed:
needs: [build_linux_macos, build_ubuntu_arm, build_windows]
needs: [build_ubuntu, build_ubuntu_arm, build_macos, build_windows]
runs-on: ubuntu-24.04
if: failure()
steps:
Expand All @@ -280,7 +301,8 @@ jobs:
publish_wheel:
if: contains(github.ref, 'tags/202')
needs:
- build_linux_macos
- build_ubuntu
- build_macos
- build_windows
strategy:
fail-fast: false
Expand Down Expand Up @@ -340,7 +362,8 @@ jobs:
create-release:
if: contains(github.ref, 'tags/202')
needs:
- build_linux_macos
- build_ubuntu
- build_macos
- build_windows
runs-on: ubuntu-24.04
timeout-minutes: 60
Expand Down

0 comments on commit cb6f6be

Please sign in to comment.