From 3980c175561bdf178825edb1a58456842c8b78e1 Mon Sep 17 00:00:00 2001 From: Thomas Calmant Date: Sat, 19 Feb 2022 17:16:12 +0100 Subject: [PATCH] Added GitHub action To be used instead of Travis --- .github/workflows/build.yml | 47 +++++++++++++++++++++++++++++++++++++ .travis.yml | 27 --------------------- run_test.sh => run_tests.sh | 0 3 files changed, 47 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml rename run_test.sh => run_tests.sh (100%) mode change 100644 => 100755 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ba13982 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: CI Build + +on: + push: + branches: '**' + tags: '**' + pull_request: + branches: '**' + +jobs: + build: + timeout-minutes: 10 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test + run: | + ./run_tests.sh + - name: Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} + run: | + pip install coveralls + coveralls diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index eea2d18..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: python -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" - -arch: - - amd64 - - ppc64le - -sudo: false - -env: - global: - - COVERAGE_PROCESS_START=".coveragerc" - -before_install: - - pip install nose coverage - -script: - - ./docker_test.sh - -after_success: - - if [[ "$TRAVIS_CPU_ARCH" != "ppc64le" ]]; then pip install coveralls && coveralls; fi; diff --git a/run_test.sh b/run_tests.sh old mode 100644 new mode 100755 similarity index 100% rename from run_test.sh rename to run_tests.sh