-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Fix mac release and integrate windows release into github (#2641)
* [ci] Fix mac release and integrate windows release into github * Auto Format * Update python/build.py Co-authored-by: Ye Kuang <[email protected]> Co-authored-by: Taichi Gardener <[email protected]> Co-authored-by: Ye Kuang <[email protected]>
- Loading branch information
1 parent
0df7941
commit b71fb81
Showing
3 changed files
with
82 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,8 @@ on: | |
types: [published] | ||
|
||
jobs: | ||
build_and_test_cpu: | ||
name: Build and Test (macOS only) | ||
build_and_upload_mac: | ||
name: Build and Upload (macOS only) | ||
strategy: | ||
matrix: | ||
include: | ||
|
@@ -25,6 +25,9 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
@@ -45,38 +48,90 @@ jobs: | |
export CXX=clang++ | ||
# TODO: making changelog shouldn't depend on taichi. | ||
# We currently install taichi to make changelog when building the wheel. | ||
python misc/ci_setup.py ci | ||
cd python | ||
python build.py build | ||
# Uninstall taichi to make sure we test the wheel. | ||
pip uninstall taichi -y | ||
python -m pip install --user numpy pybind11 gitpython pytest | ||
python setup.py develop | ||
- name: Install Wheel and Test | ||
- name: Test | ||
run: | | ||
TAICHI_REPO_DIR=`pwd` | ||
export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH | ||
NUM_WHL=`ls dist/*.whl | wc -l` | ||
if [ $NUM_WHL -ne 1 ]; then echo 'ERROR: created more than 1 whl.' && exit 1 ; fi | ||
pip install dist/*.whl | ||
python examples/algorithm/laplace.py | ||
ti diagnose | ||
ti test -vr2 -t2 | ||
ti test -cvr2 -t2 | ||
- name: Upload PyPI | ||
env: | ||
# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#using-encrypted-secrets-in-a-workflow | ||
PYPI_PWD: ${{ secrets.PYPI_PWD }} | ||
run: | | ||
cd python | ||
python build.py upload | ||
- name: Archive Wheel Artifacts | ||
# https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts#uploading-build-and-test-artifacts | ||
uses: actions/upload-artifact@v2 | ||
build_and_upload_windows: | ||
name: Build and Upload (Windows only) | ||
strategy: | ||
matrix: | ||
include: | ||
- os: windows-latest | ||
python: 3.6 | ||
with_cc: OFF | ||
- os: windows-latest | ||
python: 3.7 | ||
with_cc: OFF | ||
- os: windows-latest | ||
python: 3.8 | ||
with_cc: OFF | ||
- os: windows-latest | ||
python: 3.9 | ||
with_cc: OFF | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install 7Zip PowerShell | ||
shell: powershell | ||
run: Install-Module 7Zip4PowerShell -Force -Verbose | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
# While ${{ github.ref }} does provide the release tag, it is of | ||
# format `refs/tags/<tag_name>`, which isn't a valid file path. | ||
name: taichi-py${{ matrix.python }}-${{ matrix.os }}.whl | ||
path: dist/*.whl | ||
submodules: 'recursive' | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
|
||
- name: Build Python Wheel | ||
shell: powershell | ||
run: | | ||
cd C:\ | ||
Remove-item alias:curl | ||
curl --retry 10 --retry-delay 5 https://github.com/taichi-dev/taichi_assets/releases/download/llvm10/taichi-llvm-10.0.0-msvc2019.zip -LO | ||
7z x taichi-llvm-10.0.0-msvc2019.zip -otaichi_llvm | ||
curl --retry 10 --retry-delay 5 https://github.com/taichi-dev/taichi_assets/releases/download/llvm10/clang-10.0.0-win.zip -LO | ||
7z x clang-10.0.0-win.zip -otaichi_clang | ||
$env:PATH += ";C:\taichi_llvm\bin" | ||
$env:PATH += ";C:\taichi_clang\bin" | ||
clang --version | ||
cd D:\a\taichi\taichi | ||
python -m pip install --user numpy pybind11 gitpython pytest | ||
python setup.py develop | ||
env: | ||
CI_SETUP_CMAKE_ARGS: -G "Visual Studio 16 2019" -A x64 -DLLVM_DIR=C:\taichi_llvm\lib\cmake\llvm | ||
|
||
- name: Test | ||
shell: powershell | ||
run: | | ||
$env:PATH += ";C:\taichi_llvm\bin" | ||
$env:PATH += ";C:\taichi_clang\bin" | ||
python -c "import taichi" | ||
python examples/algorithm/laplace.py | ||
python bin/taichi diagnose | ||
python bin/taichi test -cvr2 -t2 | ||
- name: Upload PyPI | ||
shell: powershell | ||
env: | ||
# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#using-encrypted-secrets-in-a-workflow | ||
PYPI_PWD: ${{ secrets.PYPI_PWD }} | ||
run: | | ||
TAICHI_REPO_DIR=`pwd` | ||
export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH | ||
cd python | ||
python build.py try_upload --skip_build && bash <(curl -s https://codecov.io/bash) | ||
python build.py upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters