Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Workflow] Build and test the CUDA backend using GitHub actions #1863

Merged
merged 9 commits into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions .github/workflows/persubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
types: [opened, synchronize, reopened]

jobs:
build_and_test:
name: Build and Test
build_and_test_cpu:
name: Build and Test (CPU)
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip ci') && github.event.sender.login != 'taichi-gardener' }}
strategy:
matrix:
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
env:
CI_PLATFORM: ${{ matrix.os }}

- name: Build Project
- name: Build
run: |
export TAICHI_REPO_DIR=`pwd`
export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH
Expand All @@ -47,7 +47,7 @@ jobs:
env:
CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=${{ matrix.with_cc }}

- name: Functionallity Test
- name: Test
run: |
export TAICHI_REPO_DIR=`pwd`
export PATH=$TAICHI_REPO_DIR/bin:$PATH
Expand All @@ -57,6 +57,35 @@ jobs:
ti diagnose
ti test -vr2 -t2

build_and_test_cuda:
name: Build and Test (CUDA)
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip ci') && github.event.sender.login != 'taichi-gardener' }}
runs-on: [zhen]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this is our purchased server? Shall we test OpenGL or Metal there too?

steps:
- uses: actions/checkout@v2

- name: Build
run: |
git --version
export TAICHI_REPO_DIR=`pwd`
export PATH=/home/github/taichi-llvm/bin/:$PATH
export CXX=clang++-8
export PYTHON=/usr/bin/python3.7
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make use of actions/setup-python?

$PYTHON misc/ci_setup.py ci
env:
CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=${{ matrix.with_cc }}

- name: Test
run: |
export PYTHON=/usr/bin/python3.7
export TAICHI_REPO_DIR=`pwd`
export PATH=$TAICHI_REPO_DIR/bin:$PATH
export PATH=/home/github/taichi-llvm/bin/:$PATH
export PYTHONPATH=$TAICHI_REPO_DIR/python
$PYTHON examples/laplace.py
ti diagnose
ti test -vr2 -t2

check_previous_run:
name: Checks the Workflow Run of the Previous Commit
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions misc/ci_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,9 @@ def run(self):
# compile ..
os.makedirs('build', exist_ok=True)
arg = environ.get('CI_SETUP_CMAKE_ARGS', '')
execute_command('cd build && cmake .. -DTI_WITH_CUDA:BOOL=OFF ' +
arg)
execute_command(
f'cd build && cmake .. -DPYTHON_EXECUTABLE={sys.executable} {arg}'
)
execute_command('cd build && make -j 10')
return
if test_installation():
Expand Down