From 42676a3eeaa45cef91ac0181bbe9135750d0d849 Mon Sep 17 00:00:00 2001 From: Mirko Bronzi Date: Mon, 26 Apr 2021 12:14:17 -0400 Subject: [PATCH] moving to github actions (#25) * removing coverage computation * moving from travis to gitbug actions. * setting fake name/email for git. --- .github/workflows/tests.yml | 35 +++++++++++++++++++++++ .travis.yml | 11 ------- tests/end2end_pytorch/run.sh | 3 ++ tests/end2end_tensorflow/run.sh | 3 ++ {{cookiecutter.project_slug}}/.travis.yml | 1 - 5 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..04ce39b --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,35 @@ +name: unit-tests +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + push: + branches: + - master + pull_request: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: python-3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: install-dependencies + run: | + python -m pip install --upgrade pip + pip install -e . + - name: print env + run: | + env + - name: pytorch-test + run: | + ./tests/end2end_pytorch/run.sh + - name: tensorflow-test + run: | + ./tests/end2end_tensorflow/run.sh + - name: doc-creation-test + run: | + ./tests/test_docs/run.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4da7377..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: python -python: - - "3.7" -cache: pip -install: - - pip install -e . --quiet -jobs: - include: - - script: ./tests/end2end_pytorch/run.sh - - script: ./tests/end2end_tensorflow/run.sh - - script: ./tests/test_docs/run.sh diff --git a/tests/end2end_pytorch/run.sh b/tests/end2end_pytorch/run.sh index c88969d..e8383f7 100755 --- a/tests/end2end_pytorch/run.sh +++ b/tests/end2end_pytorch/run.sh @@ -7,6 +7,9 @@ cd ${DIR} cookiecutter ../.. --no-input --output-dir=./ cd wonderful_project git init +# setting some fake name/email for git: +git config --global user.email "you@example.com" +git config --global user.name "Your Name" git add -A git commit -m "initial commit" pip install -e . --quiet diff --git a/tests/end2end_tensorflow/run.sh b/tests/end2end_tensorflow/run.sh index 3d0fecc..ae5fc5e 100755 --- a/tests/end2end_tensorflow/run.sh +++ b/tests/end2end_tensorflow/run.sh @@ -7,6 +7,9 @@ cd ${DIR} python -c "from cookiecutter.main import cookiecutter; cookiecutter('../..', no_input=True, extra_context={'dl_framework': 'tensorflow_cpu'}, output_dir='./')" cd wonderful_project git init +# setting some fake name/email for git: +git config --global user.email "you@example.com" +git config --global user.name "Your Name" git add -A git commit -m "initial commit" pip install -e . --quiet diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index bebe64c..d9936a2 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -5,7 +5,6 @@ cache: pip install: # Reducing verbosity is needed because of Travis' limit on log length - pip install -e . --quiet - - pip install pytest-cov script: # run flake8 with exactly the same options as in the commit hook: - config/hooks/pre-commit