From 81ca7bf402b6243486f134d1757dd5da27dfd6b4 Mon Sep 17 00:00:00 2001 From: Michael Kim Date: Tue, 19 Oct 2021 13:32:31 -0700 Subject: [PATCH] migrate ci testing to github actions --- .github/workflows/test.yml | 55 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 17 ------------ setup.py | 2 +- 3 files changed, 56 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..fba3af5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,55 @@ +name: Test + +on: + - push + - pull_request + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - '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 + pip install setuptools + pip install -e .[ci] + - name: Lint with flake8 + run: | + flake8 ./ + - name: Test with pytest + run: | + pytest --cov --cov-report term-missing:skip-covered + - name: Upload to Coveralls + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.python-version }} + COVERALLS_PARALLEL: true + run: | + coveralls --service=github + + coveralls: + name: Indicate completion to coveralls.io + needs: test + runs-on: ubuntu-latest + container: python:3-slim + steps: + - name: Finished + run: | + pip3 install --upgrade coveralls + coveralls --service=github --finish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 64038cf..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: python - -python: - - "3.6" - -cache: pip - -install: - - pip install -U pip setuptools - - pip install -e .[ci] - -script: - - flake8 ./ - - pytest --cov --cov-report term-missing:skip-covered - -after_success: - - coveralls diff --git a/setup.py b/setup.py index a0d430b..045ba12 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ extra_ci = [ *extra_test, - 'python-coveralls', + 'coveralls', ] setup(