Skip to content

Commit

Permalink
Split test
Browse files Browse the repository at this point in the history
  • Loading branch information
mthrok committed Sep 4, 2024
1 parent 3220a74 commit f30c4c6
Show file tree
Hide file tree
Showing 10 changed files with 356 additions and 260 deletions.
84 changes: 0 additions & 84 deletions .github/workflows/conda_build.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/conda_cpu_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build Conda Package

on:
workflow_call:
inputs:
os:
required: true
type: string
python-version:
required: true
type: string
artifact:
required: true
type: string

jobs:
build:
runs-on: ${{ inputs.os }}
defaults:
run:
shell: bash -el {0}

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ inputs.python-version }}

- name: Install conda-build
run: conda install conda-build

- name: Build SPDL
run: |
mkdir ~/package
conda build \
./packaging/conda \
--python=${{ inputs.python-version }} \
--output-folder ~/package
- uses: actions/upload-artifact@v4
name: Upload build artifact
with:
name: "${{ inputs.artifact }}"
path: ~/package
if-no-files-found: error
retention-days: 1
overwrite: true
48 changes: 48 additions & 0 deletions .github/workflows/conda_cpu_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test Conda Package

on:
workflow_call:
inputs:
os:
required: true
type: string
python-version:
required: true
type: string
artifact:
required: true
type: string

jobs:
unit-test:
name: "Unit test (ffmpeg ${{ matrix.ffmpeg-version }})"
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["5", "6", "7" ]
runs-on: ${{ inputs.os }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/download-artifact@v4
with:
name: "${{ inputs.artifact }}"
path: ~/package

- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ inputs.python-version }}

- name: Unit test
run: |
conda install -c file://${HOME}/package/ spdl
conda install -c conda-forge "ffmpeg==${{ matrix.ffmpeg-version}}"
conda install -c pytorch numpy pytest pytorch numba
pytest -v \
tests/spdl_unittest/io/ \
tests/spdl_unittest/dataloader/
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@ name: Build Conda Package
on:
workflow_call:
inputs:
os-build:
os:
type: string
default: "32-core-ubuntu"
os-test:
type: string
default: "4-core-ubuntu-gpu-t4"
python-version:
required: true
type: string
run-test:
type: boolean
default: false
cu-version:
required: true
type: string
artifact:
required: true
type: string

jobs:
build:
Expand Down Expand Up @@ -61,45 +58,8 @@ jobs:
- uses: actions/upload-artifact@v4
name: Upload build artifact
with:
name: "spdl.conda.${{ inputs.os-build }}.py${{ inputs.python-version }}.cu${{ inputs.cu-version }}"
name: "${{ inputs.artifcat }}"
path: ~/package
if-no-files-found: error
retention-days: 1
overwrite: true

unit-test:
name: "Unit test (ffmpeg ${{ matrix.ffmpeg-version }})"
if: ${{ inputs.run-test }}
needs: ["build"]
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["6"]
runs-on: "${{ inputs.os-test }}"
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/download-artifact@v4
with:
name: "spdl.conda.${{ inputs.os-build }}.py${{ inputs.python-version }}.cu${{ inputs.cu-version }}"
path: ~/package

- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ inputs.python-version }}

- name: Unit test
run: |
conda install -c file://${HOME}/package/ spdl
conda install -c conda-forge "ffmpeg==${{ matrix.ffmpeg-version}}"
conda install pytorch pytorch-cuda=12.1 -c pytorch -c nvidia
conda install pytest numba
ffmpeg -version
python -c 'import logging;logging.basicConfig(level=logging.DEBUG);from spdl.lib import _libspdl;_libspdl.Demuxer'
pytest -v \
tests/spdl_unittest/cuda/
54 changes: 54 additions & 0 deletions .github/workflows/conda_cuda_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build Conda Package

on:
workflow_call:
inputs:
os:
type: string
default: "4-core-ubuntu-gpu-t4"
python-version:
required: true
type: string
cu-version:
required: true
type: string
artifact:
required: true
type: string

jobs:
unit-test:
name: "Unit test (ffmpeg ${{ matrix.ffmpeg-version }})"
if: ${{ inputs.run-test }}
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["6"]
runs-on: "${{ inputs.os }}"
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/download-artifact@v4
with:
name: "${{ inputs.artifact }}"
path: ~/package

- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ inputs.python-version }}

- name: Unit test
run: |
conda install -c file://${HOME}/package/ spdl
conda install -c conda-forge "ffmpeg==${{ matrix.ffmpeg-version}}"
conda install pytorch pytorch-cuda=${{ inputs.cu-version }} -c pytorch -c nvidia
conda install pytest numba
ffmpeg -version
python -c 'import logging;logging.basicConfig(level=logging.DEBUG);from spdl.lib import _libspdl;_libspdl.Demuxer'
pytest -v \
tests/spdl_unittest/cuda/
Loading

0 comments on commit f30c4c6

Please sign in to comment.