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

setup GitHub Actions #243

Merged
merged 14 commits into from
Jul 20, 2020
Merged
File renamed without changes.
6 changes: 4 additions & 2 deletions .travis/test.sh → .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

set -e

cd $TRAVIS_BUILD_DIR
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
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: GitHub Actions

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
name: "Python ${{ matrix.python }}, Test: ${{ matrix.lang }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- 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";
else
export TEST="E2E";
export LC_ALL="en_US.UTF-8";
sudo locale-gen $LC_ALL;
sudo update-locale;
Comment on lines +42 to +44
Copy link
Member Author

@StrikerRUS StrikerRUS Jun 12, 2020

Choose a reason for hiding this comment

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

Workaround for

Process terminated. Infinite recursion during resource lookup within System.Private.CoreLib.  This may be a bug in System.Private.CoreLib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names.  Resource name: Argument_InvalidResourceCultureName
   at System.Environment.FailFast(System.String)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String, System.String)
   at System.Globalization.CultureInfo.VerifyCultureName(System.String, Boolean)
   at System.Resources.ResourceManager.GetResourceFileName(System.Globalization.CultureInfo)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean)
   at System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean)
   at System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String, System.String)
   at System.Globalization.CultureInfo.VerifyCultureName(System.String, Boolean)
   at System.Resources.ResourceManager.GetResourceFileName(System.Globalization.CultureInfo)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean)
   at System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean)
   at System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)
   at Microsoft.DotNet.Configurer.DotnetFirstTimeUseConfigurer.PrintFirstTimeMessageWelcome()
   at Microsoft.DotNet.Configurer.DotnetFirstTimeUseConfigurer.Configure()
   at Microsoft.DotNet.Cli.Program.ConfigureDotNetForFirstTimeUse(Microsoft.DotNet.Configurer.IFirstTimeUseNoticeSentinel, Microsoft.DotNet.Configurer.IAspNetCertificateSentinel, Microsoft.DotNet.Configurer.IFileSentinel, Boolean, Microsoft.DotNet.Configurer.DotnetFirstRunConfiguration, Microsoft.DotNet.Cli.Utils.IEnvironmentProvider)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(System.String[], Microsoft.DotNet.Cli.Telemetry.ITelemetry)
   at Microsoft.DotNet.Cli.Program.Main(System.String[])

dotnet/runtime#32510

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
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ env:
- TEST=E2E LANG="r_lang or dart"

before_install:
- bash .travis/setup.sh
- bash .ci/setup.sh

install:
- pip install Cython
- pip install -r requirements-test.txt

script:
- bash .travis/test.sh
- export BUILD_DIRECTORY=$TRAVIS_BUILD_DIR
- bash .ci/test.sh
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down