From 3504443de6fb8ff3270733c04a9a94d4537d1a87 Mon Sep 17 00:00:00 2001 From: Moaz Reyad Date: Mon, 17 Aug 2020 15:59:08 +0200 Subject: [PATCH] conda build and test with Github Actions --- .github/workflows/conda.yaml | 40 ++++++++++++++++++++++++++++++++++++ test/python/run.py | 16 +++++++++------ 2 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/conda.yaml diff --git a/.github/workflows/conda.yaml b/.github/workflows/conda.yaml new file mode 100644 index 0000000000..f82f30e9a4 --- /dev/null +++ b/.github/workflows/conda.yaml @@ -0,0 +1,40 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# This is a basic workflow to help you get started with Actions + +name: conda + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + pull_request: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build-ubuntu-conda: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: install-conda-build + run: conda install conda-build + - name: conda-config + run: conda config --add channels conda-forge && conda config --add channels nusdbsystem + - name: build-singa-conda + run: conda build tool/conda/singa diff --git a/test/python/run.py b/test/python/run.py index b6e318f936..b787a15a88 100644 --- a/test/python/run.py +++ b/test/python/run.py @@ -16,11 +16,15 @@ # limitations under the License. # +import sys import unittest -# import xmlrunner -loader = unittest.TestLoader() -tests = loader.discover('.') -testRunner = unittest.runner.TextTestRunner() -# testRunner = xmlrunner.XMLTestRunner(output='.') -testRunner.run(tests) +def main(): + loader = unittest.TestLoader() + tests = loader.discover('.') + testRunner = unittest.runner.TextTestRunner() + ret = not testRunner.run(tests).wasSuccessful() + sys.exit(ret) + +if __name__ == "__main__": + main()