From e8313db49ee5476e818188891e12e7eb170c2c1d Mon Sep 17 00:00:00 2001 From: StrikerRUS Date: Sat, 13 Jun 2020 01:55:49 +0300 Subject: [PATCH 1/6] setup GitHub Actions --- {.travis => .ci}/setup.sh | 0 {.travis => .ci}/test.sh | 2 +- .github/workflows/main.yml | 48 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 1 + README.md | 3 ++- 5 files changed, 52 insertions(+), 2 deletions(-) rename {.travis => .ci}/setup.sh (100%) rename {.travis => .ci}/test.sh (92%) create mode 100644 .github/workflows/main.yml diff --git a/.travis/setup.sh b/.ci/setup.sh similarity index 100% rename from .travis/setup.sh rename to .ci/setup.sh diff --git a/.travis/test.sh b/.ci/test.sh similarity index 92% rename from .travis/test.sh rename to .ci/test.sh index 06369794..53c102e7 100644 --- a/.travis/test.sh +++ b/.ci/test.sh @@ -2,7 +2,7 @@ set -e -cd $TRAVIS_BUILD_DIR +cd $BUILD_DIRECTORY if [[ $TEST == "API" ]]; then flake8 . diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..8f0a7a70 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,48 @@ +name: GitHub Actions + +on: [push, pull_request] + +jobs: + test: + name: "Python ${{ matrix.python }}, Test: ${{ matrix.lang }}" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python: + - 3.5 + - 3.6 + - 3.7 + - 3.8 + lang: + - "API" + - "c_lang or python or java or go_lang or javascript or php or haskell or ruby" + - "c_sharp or visual_basic or powershell" + - "r_lang or dart" + steps: + - name: Checkout repository + uses: actions/checkout@v1 + with: + fetch-depth: 5 + - name: Setup Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Setup dependencies and run tests + run: | + if [[ "${{ matrix.lang }}" == "API" ]]; then + export TEST="API"; + export COVERALLS_REPO_TOKEN="COVERALLS TOKEN FOR M2CGEN"; + else + export TEST="E2E"; + export LC_ALL="en_US.UTF-8"; + sudo locale-gen $LC_ALL; + sudo update-locale; + fi + export PYTHON="${{ matrix.python }}" + export LANG="${{ matrix.lang }}" + export BUILD_DIRECTORY=$GITHUB_WORKSPACE + bash $GITHUB_WORKSPACE/.ci/setup.sh + pip install Cython numpy + pip install -r $GITHUB_WORKSPACE/requirements-test.txt + bash $GITHUB_WORKSPACE/.ci/test.sh diff --git a/.travis.yml b/.travis.yml index d84f27e2..b66c5669 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,4 +21,5 @@ install: - pip install -r requirements-test.txt script: + - export BUILD_DIRECTORY=$TRAVIS_BUILD_DIR - bash .travis/test.sh diff --git a/README.md b/README.md index cb2b58fa..24c061f3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # m2cgen -[![Build Status](https://travis-ci.org/BayesWitnesses/m2cgen.svg?branch=master)](https://travis-ci.org/BayesWitnesses/m2cgen) +[![Travis Status](https://travis-ci.org/BayesWitnesses/m2cgen.svg?branch=master)](https://travis-ci.org/BayesWitnesses/m2cgen) +[![GitHub Actions Status](https://github.com/BayesWitnesses/m2cgen/workflows/GitHub%20Actions/badge.svg?branch=master)](https://github.com/BayesWitnesses/m2cgen/actions) [![Coverage Status](https://coveralls.io/repos/github/BayesWitnesses/m2cgen/badge.svg?branch=master)](https://coveralls.io/github/BayesWitnesses/m2cgen?branch=master) [![License: MIT](https://img.shields.io/github/license/BayesWitnesses/m2cgen.svg)](https://github.com/BayesWitnesses/m2cgen/blob/master/LICENSE) [![Python Versions](https://img.shields.io/pypi/pyversions/m2cgen.svg?logo=python&logoColor=white)](https://pypi.org/project/m2cgen) From 835f7c4e2978e3ccc50579a0fd5644494c8bf86a Mon Sep 17 00:00:00 2001 From: StrikerRUS Date: Sat, 13 Jun 2020 02:07:31 +0300 Subject: [PATCH 2/6] reduce number of builds --- .github/workflows/main.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f0a7a70..a8810850 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,12 @@ name: GitHub Actions -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + branches: + - master jobs: test: From 4856d0ab4e8ccabee055882f3c70d199302ecdd7 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sat, 13 Jun 2020 17:29:25 +0300 Subject: [PATCH 3/6] hotfix for Travis builds --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b66c5669..e9559d2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ env: - TEST=E2E LANG="r_lang or dart" before_install: - - bash .travis/setup.sh + - bash .ci/setup.sh install: - pip install Cython @@ -22,4 +22,4 @@ install: script: - export BUILD_DIRECTORY=$TRAVIS_BUILD_DIR - - bash .travis/test.sh + - bash .ci/test.sh From 2a145967e739cb38ed7749038ca243d57b9a7572 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Thu, 18 Jun 2020 21:18:15 +0300 Subject: [PATCH 4/6] drop Python 3.5 from GitHub Actions config --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a8810850..818b5383 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,6 @@ jobs: fail-fast: false matrix: python: - - 3.5 - 3.6 - 3.7 - 3.8 From 12147b7090a7d5c014f5a5f8c3f280fa489d1862 Mon Sep 17 00:00:00 2001 From: StrikerRUS Date: Fri, 17 Jul 2020 00:48:40 +0300 Subject: [PATCH 5/6] run coveralls only at Travis --- .ci/test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/test.sh b/.ci/test.sh index 53c102e7..5a625363 100644 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -7,7 +7,9 @@ cd $BUILD_DIRECTORY if [[ $TEST == "API" ]]; then flake8 . pytest -v tests/ --cov=m2cgen/ --ignore=tests/e2e/ - coveralls + if [[ $TRAVIS == "true" ]]; then + coveralls + fi fi if [[ $TEST == "E2E" ]]; then From 208d166850fa4807e3ad63b26e2568a8926fa4cb Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 19 Jul 2020 23:36:31 +0300 Subject: [PATCH 6/6] remove outdated code --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 818b5383..55274835 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,6 @@ jobs: run: | if [[ "${{ matrix.lang }}" == "API" ]]; then export TEST="API"; - export COVERALLS_REPO_TOKEN="COVERALLS TOKEN FOR M2CGEN"; else export TEST="E2E"; export LC_ALL="en_US.UTF-8";