diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2f5c1a6..0de3999 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -8,11 +8,8 @@ name: "CodeQL" on: push: branches: [master] - pull_request: - # The branches below must be a subset of the branches above - branches: [master] schedule: - - cron: '0 14 * * 6' + - cron: "0 14 * * 6" jobs: analyze: @@ -24,48 +21,48 @@ jobs: matrix: # Override automatic language detection by changing the below list # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['python'] + language: ["python"] # Learn more... # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - #- run: | - # make bootstrap - # make release + #- run: | + # make bootstrap + # make release - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml new file mode 100644 index 0000000..4760bcd --- /dev/null +++ b/.github/workflows/format-check.yml @@ -0,0 +1,25 @@ +name: Format check + +on: push + +jobs: + format-check: + name: Check Codebase format + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install dependencies + run: pip install -r requirements_test.txt + + - name: Run Black + run: | + black --version + black . --check diff --git a/.github/workflows/run-test-suite.yml b/.github/workflows/run-test-suite.yml new file mode 100644 index 0000000..18c4512 --- /dev/null +++ b/.github/workflows/run-test-suite.yml @@ -0,0 +1,27 @@ +name: Run Test Suite + +on: push + +jobs: + run-test-suite: + name: Run Test Suite + runs-on: ubuntu-latest + strategy: + matrix: + python_version: [3.6, 3.7, 3.8] + django_version: [2.2, 3.1] + + steps: + - name: Checkout code + 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: pip install -r requirements_test.txt + + - name: Run Tests + run: tox -e py${{ matrix.python_version }}-django${{ matrix.django_version }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a678aaa..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -# Config file for automatic testing at travis-ci.org - -stages: - - format - - test - -language: python - -jobs: - include: - - stage: format - name: "Black format check" - python: "3.7" - install: pip install black - script: - - black --version - - black . --check - after_success: "" - -python: - - "3.6" - - "3.7" - - "3.8" - -env: - - DJANGO_VERSION=django-22 - - DJANGO_VERSION=django-30 - -# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors -install: pip install -r requirements_test.txt - -# command to run tests using coverage, e.g. python setup.py test -script: tox -e $(echo py$TRAVIS_PYTHON_VERSION-$DJANGO_VERSION | tr -d .) - -after_success: - - coveralls diff --git a/HISTORY.rst b/HISTORY.rst index b3e499f..4f2b7bc 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,6 +9,7 @@ Development * Challenges are now stored on the database. No longer expire when a new one is generated. * Added initial support for DRF, TokenAuthentication only. +* Move CI from Travis-ci to Github Actions 0.1.0 (2020-03-31) diff --git a/README.rst b/README.rst index 10337fc..2762bfe 100644 --- a/README.rst +++ b/README.rst @@ -2,15 +2,6 @@ Django-Cryptolock ============================= -.. image:: https://badge.fury.io/py/django-cryptolock.svg - :target: https://badge.fury.io/py/django-cryptolock - -.. image:: https://travis-ci.org/dethos/django-cryptolock.svg?branch=master - :target: https://travis-ci.org/dethos/django-cryptolock - -.. image:: https://coveralls.io/repos/github/dethos/django-cryptolock/badge.svg - :target: https://coveralls.io/github/dethos/django-cryptolock - Authentication using cryptocurrency wallets for Django projects. This package provides a django app containing a set of utilities to diff --git a/requirements_test.txt b/requirements_test.txt index 216c6ce..c8dacb7 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -14,3 +14,4 @@ pytest pytest-django pytest-cov model_mommy +black diff --git a/tox.ini b/tox.ini index c4d29f3..c0c8bc7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,17 @@ [tox] envlist = - {py36,py37,py38}-django-{22,30} + {py3.6,py3.7,py3.8}-django{2.2,3.1} [testenv] setenv = PYTHONPATH = {toxinidir}:{toxinidir}/django_cryptolock -commands = pytest --cov=django_cryptolock tests/ +commands = + pytest --cov=django_cryptolock tests/ deps = - django-22: django>=2.2,<3.0 - django-30: django>=3.0,<3.1 + django2.2: django>=2.2,<3.0 + django3.1: django>=3.1,<3.2 -r {toxinidir}/requirements_test.txt basepython = - py38: python3.8 - py37: python3.7 - py36: python3.6 + py3.8: python3.8 + py3.7: python3.7 + py3.6: python3.6