diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml new file mode 100644 index 0000000..58aaec2 --- /dev/null +++ b/.github/workflows/workflow.yaml @@ -0,0 +1,110 @@ +on: + push: + schedule: + - cron: '0 3 * * 6' + +jobs: + lint: + name: "Lint" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: 'Install Dependencies' + run: | + python -m pip install --upgrade pip + python -m pip install tox + - name: 'Lint' + run: tox + env: + TOXENV: 'lint' + + docs: + name: "Build Docs" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: 'Install Dependencies' + run: | + python -m pip install --upgrade pip + python -m pip install tox + + - name: 'Build Docs' + run: tox + env: + TOXENV: 'docs' + + test: + name: "Test" + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [pypy3, 3.5, 3.6, 3.7, 3.8, 3.9] + include: + - python-version: pypy3 + toxenv: pypy3 + - python-version: 3.5 + toxenv: py35 + - python-version: 3.6 + toxenv: py36 + - python-version: 3.7 + toxenv: py37 + - python-version: 3.8 + toxenv: py38 + - python-version: 3.9 + toxenv: py39 + + steps: + - uses: actions/checkout@v2 + - 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 tox wheel + + - name: 'Run Tests (with coverage)' + run: tox + env: + TOXENV: ${{ matrix.toxenv }} + - uses: codecov/codecov-action@v2 + if: ${{ matrix.python-version == '3.9' }} + - name: "Build Package 📦" + run: | + git describe --tags --exact-match > VERSION || true + python setup.py sdist bdist_wheel + - uses: actions/upload-artifact@v2 + # Only publish artifacts from Python latest build. + if: ${{ matrix.python-version == '3.9' }} + with: + name: dist + path: dist/ + if-no-files-found: error + + release: + name: "Release 🚀" + runs-on: ubuntu-latest + needs: + - test + - docs + - lint + if: startsWith(github.ref, 'refs/tags') + steps: + - uses: actions/download-artifact@v2 + with: + name: dist + path: dist/ + - name: Release to PyPi 📦 + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} + - name: Create Github Release + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true diff --git a/README.rst b/README.rst index a07bd82..5b72dfe 100644 --- a/README.rst +++ b/README.rst @@ -1,8 +1,8 @@ Flask-LDAP3-Login ============================================ -.. image:: https://travis-ci.org/nickw444/flask-ldap3-login.svg?branch=master - :target: https://travis-ci.org/nickw444/flask-ldap3-login +.. image:: https://github.com/nickw444/flask-ldap3-login/actions/workflows/workflow.yaml/badge.svg + :target: https://github.com/nickw444/flask-ldap3-login/actions/workflows/workflow.yaml .. image:: https://coveralls.io/repos/nickw444/flask-ldap3-login/badge.svg :target: https://coveralls.io/r/nickw444/flask-ldap3-login diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index a5c32da..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,115 +0,0 @@ -trigger: - branches: - include: - - master - tags: - include: - - '*' - -schedules: -- cron: '0 3 * * 6' - displayName: "Weekly scheduled build" - branches: - include: - - 'master' - always: true - -pool: - vmImage: ubuntu-latest - -variables: -- name: python.version - value: 3.x - -parameters: -- name: step_install_dependencies - type: stepList - default: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - displayName: 'Use Python $(python.version)' - - script: | - python -m pip install --upgrade pip - pip install tox - displayName: 'Install Dependencies' - -jobs: - - job: lint - displayName: "Lint" - steps: - - ${{ parameters.step_install_dependencies }} - - script: tox - displayName: 'Lint' - env: - TOXENV: 'lint' - - job: docs - displayName: "Build Docs" - steps: - - ${{ parameters.step_install_dependencies }} - - script: tox - displayName: 'Build Docs' - env: - TOXENV: 'docs' - - job: test - displayName: "Test" - strategy: - matrix: - PythonPyPy3: - python.version: 'pypy3' - tox.env: 'pypy3' - Python35: - python.version: '3.5' - tox.env: 'py35' - Python36: - python.version: '3.6' - tox.env: 'py36' - Python37: - python.version: '3.7' - tox.env: 'py37' - Python38: - python.version: '3.8' - tox.env: 'py38' - steps: - - ${{ parameters.step_install_dependencies }} - - script: tox - displayName: 'Run Tests (with coverage)' - env: - TOXENV: $(tox.env) - - script: | - bash <(curl -s https://codecov.io/bash) - displayName: 'Upload to codecov.io' - # Only publish coverage from Python latest build. - condition: eq(variables['python.version'], '3.8') - - job: release - dependsOn: - - test - - docs - - lint - displayName: "Release" - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) - steps: - - ${{ parameters.step_install_dependencies }} - - script: | - pip install twine wheel - displayName: 'Install Release Dependencies' - - script: | - set -e - git describe --exact-match > VERSION - python setup.py sdist bdist_wheel - displayName: 'Build Release' - - task: TwineAuthenticate@1 - inputs: - pythonUploadServiceConnection: 'flask-ldap3-login' - - script: | - python -m twine upload -r 'flask-ldap3-login' --config-file $(PYPIRC_PATH) dist/*.{whl,tar.gz} - displayName: "Release to PyPi" - - task: GitHubRelease@1 - inputs: - gitHubConnection: 'github.com_nickw444' - repositoryName: '$(Build.Repository.Name)' - action: 'create' - target: '$(Build.SourceVersion)' - tagSource: 'gitTag' - changeLogCompareToRelease: 'lastFullRelease' - changeLogType: 'commitBased' diff --git a/tox.ini b/tox.ini index e85e104..267416d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py35,py36,py37,py38,pypy3,lint,docs +envlist = py35,py36,py37,py38,py39,pypy3,lint,docs [isort] multi_line_output=3