From 77b983260671edf870b743b7fa42da9a6c767f49 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Fri, 1 May 2020 14:04:36 +0100 Subject: [PATCH] Add GitHub actions (#947) --- .github/workflows/deploy.yml | 25 +++++++++++++ .github/workflows/lint.yml | 22 ++++++++++++ .github/workflows/tests.yml | 28 +++++++++++++++ .travis.yml | 68 ------------------------------------ tox.ini | 10 ++++-- 5 files changed, 83 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..5dd418e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,25 @@ +name: 🚀 Deploy to PyPI + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Build wheel and source tarball + run: | + python setup.py sdist bdist_wheel + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@v1.1.0 + with: + user: __token__ + password: ${{ secrets.pypi_password }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..20cf7fb --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,22 @@ +name: Lint + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + - name: Run lint 💅 + run: tox + env: + TOXENV: flake8 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..11dcd98 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,28 @@ +name: Tests + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + django: ["1.11", "2.2", "3.0"] + python-version: ["3.6", "3.7", "3.8"] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions + - name: Test with tox + run: tox + env: + DJANGO: ${{ matrix.django }} + TOXENV: ${{ matrix.toxenv }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f1ca201..0000000 --- a/.travis.yml +++ /dev/null @@ -1,68 +0,0 @@ -language: python -cache: pip -dist: xenial - -install: - - pip install tox tox-travis - -script: - - tox - -after_success: - - pip install coveralls - - coveralls - -stages: - - test - - name: deploy - if: tag IS present - -jobs: - fast_finish: true - - allow_failures: - - env: DJANGO=master - - include: - - python: 3.6 - env: DJANGO=1.11 - - python: 3.6 - env: DJANGO=2.2 - - python: 3.6 - env: DJANGO=3.0 - - python: 3.6 - env: DJANGO=master - - - python: 3.7 - env: DJANGO=1.11 - - python: 3.7 - env: DJANGO=2.2 - - python: 3.7 - env: DJANGO=3.0 - - python: 3.7 - env: DJANGO=master - - - python: 3.8 - env: DJANGO=1.11 - - python: 3.8 - env: DJANGO=2.2 - - python: 3.8 - env: DJANGO=3.0 - - python: 3.8 - env: DJANGO=master - - - python: 3.8 - env: TOXENV=black,flake8 - - - stage: deploy - script: skip - python: 3.8 - after_success: true - deploy: - provider: pypi - user: syrusakbary - on: - tags: true - password: - secure: kymIFCEPUbkgRqe2NAXkWfxMmGRfWvWBOP6LIXdVdkOOkm91fU7bndPGrAjos+/7gN0Org609ZmHSlVXNMJUWcsL2or/x5LcADJ4cZDe+79qynuoRb9xs1Ri4O4SBAuVMZxuVJvs8oUzT2R11ql5vASSMtXgbX+ZDGpmPRVZStkCuXgOc4LBhbPKyl3OFy7UQFPgAEmy3Yjh4ZSKzlXheK+S6mmr60+DCIjpaA0BWPxYK9FUE0qm7JJbHLUbwsUP/QMp5MmGjwFisXCNsIe686B7QKRaiOw62eJc2R7He8AuEC8T9OM4kRwDlecSn8mMpkoSB7QWtlJ+6XdLrJFPNvtrOfgfzS9/96Qrw9WlOslk68hMlhJeRb0s2YUD8tiV3UUkvbL1mfFoS4SI9U+rojS55KhUEJWHg1w7DjoOPoZmaIL2ChRupmvrFYNAGae1cxwG3Urh+t3wYlN3gpKsRDe5GOT7Wm2tr0ad3McCpDGUwSChX59BAJXe/MoLxkKScTrMyR8yMxHOF0b4zpVn5l7xB/o2Ik4zavx5q/0rGBMK2D+5d+gpQogKShoquTPsZUwO7sB5hYeH2hqGqpeGzZtb76E2zZYd18pJ0FsBudm5+KWjYdZ+vbtGrLxdTXJ1EEtzVXm0lscykTpqUucbXSa51dhStJvW2xEEz6p3rHo= - distributions: "sdist bdist_wheel" diff --git a/tox.ini b/tox.ini index 18bbd30..8e01632 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,13 @@ envlist = py{36,37,38}-django{111,22,30,master}, black,flake8 -[travis:env] +[gh-actions] +python = + 3.6: py36 + 3.7: py37 + 3.8: py38 + +[gh-actions:env] DJANGO = 1.11: django111 2.2: django22 @@ -34,4 +40,4 @@ commands = basepython = python3.8 deps = -e.[dev] commands = - flake8 graphene_django examples + flake8 graphene_django examples setup.py