Skip to content

Commit

Permalink
[ci] GitHub Actions: Merge CPU & GPU tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
feisuzhu committed Nov 8, 2022
1 parent 7a5dac0 commit b04fa3a
Showing 1 changed file with 3 additions and 154 deletions.
157 changes: 3 additions & 154 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,96 +105,6 @@ jobs:
CR_PAT: ${{ secrets.GITHUB_TOKEN }}
CI_SETUP_CMAKE_ARGS: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DTI_WITH_OPENGL:BOOL=ON -DTI_WITH_CC:BOOL=ON -DTI_WITH_VULKAN:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON

build_and_test_cpu_linux:
name: Build and Test linux (CPU)
needs: check_files
timeout-minutes: 300
strategy:
matrix:
include:
- os: ubuntu-latest
python: py39
with_cc: ON
wanted_archs: 'cpu,cc'
- os: ubuntu-latest
python: py310
with_cc: ON
wanted_archs: 'cpu,cc'
runs-on: ${{ matrix.os }}
permissions:
packages: read
contents: read
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
submodules: 'recursive'

- name: Get Build Cache
uses: actions/cache@v2
with:
path: /tmp/build-cache
key: build-cache-linux-${{ github.sha }}
restore-keys: |
build-cache-linux-
- name: Prepare Environment
run: |
. .github/workflows/scripts/common-utils.sh
prepare-build-cache /tmp/build-cache
echo CI_DOCKER_RUN_EXTRA_ARGS="-v $(pwd):/home/dev/taichi" >> $GITHUB_ENV
sudo -n chown -R 1000:1000 . || true
- name: Get Docker Images
if: needs.check_files.outputs.run_job == 'true'
run: |
# https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio
docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
docker pull ghcr.io/taichi-dev/taichidev-cpu-ubuntu18.04:v0.3.3
- name: Build
if: needs.check_files.outputs.run_job == 'true'
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run \
ghcr.io/taichi-dev/taichidev-cpu-ubuntu18.04:v0.3.3 \
/home/dev/taichi/.github/workflows/scripts/unix-build.sh
env:
PY: ${{ matrix.python }}
PROJECT_NAME: taichi
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=OFF
-DTI_WITH_CC:BOOL=${{ matrix.with_cc }}
-DTI_WITH_VULKAN:BOOL=OFF
-DTI_BUILD_TESTS:BOOL=ON
-DTI_WITH_C_API=ON
LLVM_VERSION: 15

- name: Test
id: test
if: needs.check_files.outputs.run_job == 'true'
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run \
ghcr.io/taichi-dev/taichidev-cpu-ubuntu18.04:v0.3.3 \
/home/dev/taichi/.github/workflows/scripts/unix_test.sh
env:
PY: ${{ matrix.python }}
TI_WANTED_ARCHS: ${{ matrix.wanted_archs }}

- name: Save wheel if test failed
if: failure() && steps.test.conclusion == 'failure'
uses: actions/upload-artifact@v3
with:
name: broken-wheel
path: dist/*
retention-days: 7

- name: Fix Cache Permissions
run: |
sudo -n chmod -R 0777 /tmp/build-cache || true
build_and_test_cpu_mac:
name: Build and Test macos (CPU)
needs: check_files
Expand Down Expand Up @@ -262,67 +172,6 @@ jobs:
path: dist/*
retention-days: 7

build_and_test_cpu_windows:
name: Build and Test Windows (CPU)
needs: check_files
strategy:
matrix:
include:
- os: windows-2019
llvmVer : '15'
- os: windows-2019
llvmVer : '10'
timeout-minutes: 300
runs-on: windows-2019
permissions:
packages: read
contents: read
env:
PY: "3.7"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
submodules: 'recursive'

- name: Get Build Cache
uses: actions/cache@v3
if: needs.check_files.outputs.run_job == 'true'
with:
# env.LocalAppData is not usable according to actions/cache README
path: ~/AppData/Local/build-cache
key: build-cache-win64-cpu-${{ github.sha }}
restore-keys: |
build-cache-win64-cpu-
- name: Prepare Environment
shell: pwsh
if: needs.check_files.outputs.run_job == 'true'
run: |
. .github/workflows/scripts/common-utils.ps1
Invoke docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
Invoke docker pull ghcr.io/taichi-dev/taichidev-cpu-windows:v0.0.2
PrepareBuildCache
echo CI_DOCKER_RUN_EXTRA_ARGS="--entrypoint pwsh.exe -v ${pwd}:D: -w D:/" >> $env:GITHUB_ENV
- name: Build
shell: pwsh
if: needs.check_files.outputs.run_job == 'true'
run: |
. .github/workflows/scripts/common-utils.ps1
CIDockerRun `
ghcr.io/taichi-dev/taichidev-cpu-windows:v0.0.2 `
.github/workflows/scripts/win_build.ps1 -llvmVer ${{ matrix.llvmVer }} -libsDir X:/
env:
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=OFF
-DTI_WITH_CC:BOOL=OFF
-DTI_WITH_VULKAN:BOOL=OFF
-DTI_WITH_CUDA:BOOL=OFF
-DTI_BUILD_TESTS:BOOL=OFF
-DTI_WITH_DX12:BOOL=OFF
- name: Test
shell: pwsh
if: needs.check_files.outputs.run_job == 'true'
Expand Down Expand Up @@ -396,7 +245,7 @@ jobs:
/home/dev/taichi/.github/workflows/scripts/unix_test.sh
env:
PY: py38
TI_WANTED_ARCHS: 'cuda,vulkan,opengl'
TI_WANTED_ARCHS: 'cc,cpu,cuda,vulkan,opengl'
TI_DEVICE_MEMORY_GB: '1'
TI_RUN_RELEASE_TESTS: '1'

Expand Down Expand Up @@ -424,11 +273,11 @@ jobs:
include:
- os: windows-2019
llvmVer : '15'
archs: "cuda"
archs: "cpu,cuda"
runsOn: [self-hosted, windows, cuda]
- os: windows-2019
llvmVer : '10'
archs: "cuda,opengl"
archs: "cpu,cuda,opengl"
runsOn: [self-hosted, windows, cuda, OpenGL]
runs-on: ${{ matrix.runsOn }}
timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 180 }}
Expand Down

0 comments on commit b04fa3a

Please sign in to comment.