diff --git a/.github/workflows/build_wheels_for_vtag.yml b/.github/workflows/build_wheels_for_vtag.yml new file mode 100644 index 0000000..b902cdc --- /dev/null +++ b/.github/workflows/build_wheels_for_vtag.yml @@ -0,0 +1,90 @@ +name: Test TrajDL on tag v + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v4 + + - uses: pypa/cibuildwheel@v2.22 + + - name: Check wheels + run: | + ls wheelhouse + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: dist-${{ github.ref_name }}-${{ github.sha }}-wheel + path: wheelhouse/*.whl + retention-days: 1 + overwrite: true + + test_wheels: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + name: dist-${{ github.ref_name }}-${{ github.sha }}-wheel + path: dist + + - name: Install TrajDL + run: | + python -m pip install --upgrade pip + python -m pip install torch --index-url https://download.pytorch.org/whl/cpu + PYTHON_VERSION=${{ matrix.python-version }} + PYTHON_VERSION_NO_DOT="${PYTHON_VERSION/./}" + python -m pip install "dist/trajdl-0.1.0-cp${PYTHON_VERSION_NO_DOT}-cp${PYTHON_VERSION_NO_DOT}-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" + + - name: Cache datasets + id: cache-datasets + uses: actions/cache@v3 + with: + path: ~/.cache/trajdl + key: trajdl-cache-datasets + + - name: Test with pytest + run: | + autoflake -j 0 --remove-all-unused-imports --in-place --recursive --ignore-init-module-imports . + isort -j -1 . + black . + pytest -s + + - name: Build SDist + run: | + if [ "${{ matrix.python-version }}" = "3.12" ]; then + python -m build --sdist + fi + + - name: Upload artifacts + if: matrix.python-version == '3.12' + uses: actions/upload-artifact@v4 + with: + name: dist-${{ github.ref_name }}-${{ github.sha }}-${{ matrix.python-version }} + path: dist/ + retention-days: 1 + overwrite: true diff --git a/.github/workflows/test_trajdl_vtag.yml b/.github/workflows/test_trajdl_vtag.yml deleted file mode 100644 index 4defb7f..0000000 --- a/.github/workflows/test_trajdl_vtag.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test TrajDL on tag v - -on: - push: - tags: - - 'v*' - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - - steps: - - uses: actions/checkout@v4 - - - uses: pypa/cibuildwheel@v2.22 - env: - CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64" - - - name: Check wheels - run: | - ls wheelhouse - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: dist-${{ github.ref_name }}-${{ github.sha }}-wheel - path: wheelhouse/*.whl - retention-days: 1 - overwrite: true diff --git a/pyproject.toml b/pyproject.toml index 230715b..27b09cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,6 +94,7 @@ wheel.expand-macos-universal-tags = true [tool.cibuildwheel] build-frontend = "build[uv]" +build = "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64" [tool.cibuildwheel.pyodide] build-frontend = {name = "build", args = ["--exports", "whole_archive"]} \ No newline at end of file