Skip to content

Commit

Permalink
[ci] Move extract zip into ci_download.py (#3251)
Browse files Browse the repository at this point in the history
* move extract zip into ci_download.py

* use system unzip
  • Loading branch information
frostming authored Oct 25, 2021
1 parent fac2118 commit f71246e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 44 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,14 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Download Pre-Built LLVM 10.0.0
run: |
python misc/ci_download.py
mkdir taichi-llvm
cd taichi-llvm
unzip ../taichi-llvm.zip
run: python misc/ci_download.py
env:
CI_PLATFORM: ${{ matrix.os }}

Expand Down Expand Up @@ -65,18 +61,14 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Download Pre-Built LLVM 10.0.0
run: |
python misc/ci_download.py
mkdir taichi-llvm
cd taichi-llvm
unzip ../taichi-llvm.zip
run: python misc/ci_download.py
env:
CI_PLATFORM: ${{ matrix.os }}

Expand All @@ -103,7 +95,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- name: Build
run: |
Expand All @@ -128,14 +120,13 @@ jobs:
runs-on: windows-latest
timeout-minutes: 60
steps:

- name: Install 7Zip PowerShell
shell: powershell
run: Install-Module 7Zip4PowerShell -Force -Verbose

- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -205,7 +196,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- name: Build
run: |
Expand Down
23 changes: 7 additions & 16 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,14 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Download Pre-Built LLVM 10.0.0
run: |
python misc/ci_download.py
mkdir taichi-llvm
cd taichi-llvm
unzip ../taichi-llvm.zip
run: python misc/ci_download.py
env:
CI_PLATFORM: ${{ matrix.os }}

Expand Down Expand Up @@ -135,18 +131,14 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Download Pre-Built LLVM 10.0.0
run: |
python misc/ci_download.py
mkdir taichi-llvm
cd taichi-llvm
unzip ../taichi-llvm.zip
run: python misc/ci_download.py
env:
CI_PLATFORM: ${{ matrix.os }}

Expand Down Expand Up @@ -174,7 +166,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- name: Build
run: |
Expand All @@ -201,14 +193,13 @@ jobs:
runs-on: windows-latest
timeout-minutes: 90
steps:

- name: Install 7Zip PowerShell
shell: powershell
run: Install-Module 7Zip4PowerShell -Force -Verbose

- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -279,7 +270,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- name: Build
run: |
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- name: Create Python Wheel
run: |
Expand Down Expand Up @@ -114,18 +114,14 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Download Pre-Built LLVM 10.0.0
run: |
python misc/ci_download.py
mkdir taichi-llvm
cd taichi-llvm
unzip ../taichi-llvm.zip
run: python misc/ci_download.py
env:
CI_PLATFORM: macos-latest

Expand Down Expand Up @@ -183,7 +179,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- name: Build
run: |
Expand Down Expand Up @@ -237,7 +233,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- name: Build
run: |
Expand Down Expand Up @@ -292,7 +288,6 @@ jobs:
if [ $PROJECT_NAME == "taichi-nightly" ]; then export PYPI_PWD="$NIGHT_PWD" && python3 build.py upload --skip_build --testpypi --project_name $PROJECT_NAME
elif [ $PROJECT_NAME == "taichi" ]; then export PYPI_PWD="$PROD_PWD" && python3 build.py upload --skip_build; fi
build_and_upload_windows:
name: Build and Upload (Windows only)
needs: matrix_prep
Expand All @@ -307,7 +302,7 @@ jobs:

- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- uses: actions/setup-python@v2
with:
Expand Down
11 changes: 10 additions & 1 deletion misc/ci_download.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os
import sys
import urllib.request

platform = os.environ['CI_PLATFORM']
if platform.startswith('macos'):
Expand All @@ -11,5 +13,12 @@
raise Exception(f'Bad CI_PLATFORM={platform}')

llvm_url = f'https://github.com/taichi-dev/taichi_assets/releases/download/llvm10/taichi-llvm-10.0.0-{platform}.zip'
target_dir = 'taichi-llvm'
print(f'Downloading LLVM from {llvm_url}...')
os.system(f'wget {llvm_url} --waitretry=3 --tries=5 -O taichi-llvm.zip')
urllib.request.urlretrieve(llvm_url, "taichi-llvm.zip")
print(f'Extract zip to local dir {target_dir}...')
if not os.path.exists(target_dir):
os.makedirs(target_dir)

retcode = os.system(f"unzip taichi-llvm.zip -d {target_dir}")
sys.exit(retcode)

0 comments on commit f71246e

Please sign in to comment.