Skip to content

Commit

Permalink
Split GHA into 2 workflows (#9578)
Browse files Browse the repository at this point in the history
Co-authored-by: driazati <[email protected]>
  • Loading branch information
driazati and driazati authored Nov 29, 2021
1 parent 3bdcf87 commit 7e673f8
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 45 deletions.
22 changes: 22 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
runs:
using: "composite"
steps:
- uses: actions/cache@v1
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda/build-environment.yaml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: tvm-build
channel-priority: strict
environment-file: conda/build-environment.yaml
auto-activate-base: false
use-only-tar-bz2: true
- name: Conda info
shell: pwsh
run: |
conda info
conda list
78 changes: 33 additions & 45 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# We use it to cover windows and mac builds
# Jenkins is still the primary CI

name: WinMacBuild
name: CI

on:
push:
Expand All @@ -30,49 +30,25 @@ on:
branches:
- main

jobs:
Build:
strategy:
matrix:
os: [windows-2016, macOS-latest]

runs-on: ${{ matrix.os }}
concurrency:
group: CI-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
MacOS:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Initialize submodules
run: git submodule update --recursive --init
- uses: actions/cache@v1
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda/build-environment.yaml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: tvm-build
channel-priority: strict
environment-file: conda/build-environment.yaml
auto-activate-base: false
use-only-tar-bz2: true
- name: Conda info
run: |
conda info
conda list
- name: Conda-Build@Win
if: startsWith(matrix.os, 'windows')
shell: cmd /C call {0}
run: >-
conda build --output-folder=conda/pkg conda/recipe &&
conda install tvm -c ./conda/pkg
- name: Conda-Build@MacOS
if: startsWith(matrix.os, 'macOS')
submodules: 'recursive'
- name: Set up environment
uses: ./.github/actions/setup
- name: Conda Build
shell: bash -l {0}
run: >-
conda build --output-folder=conda/pkg conda/recipe &&
conda install tvm -c ./conda/pkg
- name: Build iOS RPC@MacOS
if: startsWith(matrix.os, 'macOS')
- name: Build iOS RPC
run: |
IOS_VERSION="14.0"
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -88,22 +64,34 @@ jobs:
cd build-ios-simulator
cmake .. ${CMAKE_FLAGS}
cmake --build . --target ios_rpc
- name: Test@Win
if: startsWith(matrix.os, 'windows')
shell: cmd /C call {0}
run: >-
python -m pytest -v tests/python/all-platform-minimal-test
- name: Test@MacOS
if: startsWith(matrix.os, 'macOS')
- name: Test
shell: bash -l {0}
run: >-
python -m pytest -v tests/python/all-platform-minimal-test
- name: Test iOS RPC@MacOS
if: startsWith(matrix.os, 'macOS')
- name: Test iOS RPC
shell: bash -l {0}
run: >-
python -m pip install tornado psutil cloudpickle &&
export PYTHONPATH=tests/python/contrib:${PYTHONPATH} &&
export BUNDLE_ID=org.apache.tvmrpc &&
export BUNDLE_PATH=build-ios-simulator/apps/ios_rpc/ios_rpc/src/ios_rpc-build/Release-iphonesimulator/tvmrpc.app &&
python -m pytest -v tests/python/contrib/test_rpc_server_device.py
Windows:
runs-on: windows-2016
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up environment
uses: ./.github/actions/setup
- name: Conda Build
shell: cmd /C call {0}
run: >-
conda build --output-folder=conda/pkg conda/recipe &&
conda install tvm -c ./conda/pkg
- name: Test
shell: cmd /C call {0}
run: >-
python -m pytest -v tests/python/all-platform-minimal-test

0 comments on commit 7e673f8

Please sign in to comment.