From 5a0e4a53f26094794ffbe805b405b089c4f848ee Mon Sep 17 00:00:00 2001 From: Erick Daniszewski Date: Mon, 17 Aug 2020 08:17:59 -0400 Subject: [PATCH] ci: setup basic github actions for project --- .github/workflows/lint.yaml | 21 +++++++++++++++++++++ .github/workflows/test.yaml | 25 +++++++++++++++++++++++++ tox.ini | 15 ++++++++++++++- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lint.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000..0ff4377e --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,21 @@ +name: lint +on: + push: {} + pull_request: {} +jobs: + lint: + runs-on: ubuntu-latest + name: Python 3.8 Lint + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install dependencies + run: | + python -m pip install -U pip setuptools wheel + python -m pip install -U tox tox-gh-actions + - name: Lint + run: tox -e lint diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..c2762b83 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,25 @@ +name: test +on: + push: {} + pull_request: {} +jobs: + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + py-version: ['3.6', '3.7', '3.8'] + name: Python ${{ matrix.py-version }} Test + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.py-version }} + - name: Install dependencies + run: | + python -m pip install -U pip setuptools wheel + python -m pip install -U tox tox-gh-actions + - name: Run tests + run: tox tests/unit diff --git a/tox.ini b/tox.ini index f5cee0b9..d7e8e33d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,20 @@ [tox] -envlist = py3 +envlist = py{36,37,38} +skip_missing_interpreters = True + + +[gh-actions] +python = + 3.6: py36 + 3.7: py37 + 3.8: py38,lint [testenv] +basepython = + py36: python3.6 + py37: python3.7 + py38: python3.8 deps = pip-tools commands = @@ -33,6 +45,7 @@ commands = [testenv:lint] +basepython=python3 deps = isort>=5.0.0 flake8