Skip to content

dbg

dbg #237

Workflow file for this run

name: CI
on:
- push
permissions:
issues: write
pull-requests: write
# For GitHub Comment Reporter
# https://megalinter.io/latest/reporters/GitHubCommentReporter/
jobs:
mega-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Mega-Linter
- name: Mega-Linter
id: ml
# You can override Mega-Linter flavor used to have faster performances
# More info at https://megalinter.io/flavors/
uses: oxsecurity/megalinter/flavors/python@v7
env:
# All available variables are described in documentation
# https://megalinter.io/config-file/
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload Mega-Linter artifacts
- name: Archive production artifacts
if: ${{ success() }} || ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: Mega-Linter reports
path: |
megalinter-reports
mega-linter.log
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/Pipfile') }}
restore-keys: |
pip-${{ runner.os }}-${{ matrix.python-version }}-
pip-${{ runner.os }}-
pip-
- name: Cache pipenv
uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: pipenv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/Pipfile') }}
restore-keys: |
pipenv-${{ runner.os }}-${{ matrix.python-version }}-
pipenv-${{ runner.os }}-
pipenv-
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pipx
python3 -m pipx ensurepath
python3 -m pipx run pipenv --python ${{ matrix.python-version }}
python3 -m pipx run pipenv install --dev --skip-lock
# It seems that `pipenv lock` does not understand markers. We have
# to `--skip-lock`.
- name: Lint
run: |
python3 -m pipx run pipenv run lint
- name: Test
run: |
python3 -m pipx run pipenv run test
- name: Upload Coverage Report
run: |
python3 -m pipx run pipenv run codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
continue-on-error: true
- name: Packaging Test
run: |
python3 -m pipx run pipenv run clean
python3 -m pipx run pipenv run package
python3 -m pipx run pipenv run check-package
continue-on-error: true
# Figure out which versions of Python work well with Invoke, since
# Invoke may not work with recent Python releases.
#
# https://github.com/pyinvoke/invoke/issues/833#issuecomment-1293148106
# https://github.com/pyinvoke/invoke/pull/458
# https://github.com/pyinvoke/invoke/pull/606
package:
runs-on: ubuntu-latest
needs:
- mega-linter
- test
steps:
- uses: actions/checkout@v3
- name: Setup Python 3.10
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.10"
# Package with Python 3.10
#
# https://github.com/pyinvoke/invoke/issues/833#issuecomment-1293148106
# https://github.com/pyinvoke/invoke/pull/458
# https://github.com/pyinvoke/invoke/pull/606
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/Pipfile') }}
restore-keys: |
pip-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-
pip-${{ runner.os }}-
pip-
- name: Cache pipenv
uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: pipenv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/Pipfile') }}
restore-keys: |
pipenv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-
pipenv-${{ runner.os }}-
pipenv-
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pipx
python3 -m pipx ensurepath
python3 -m pipx run pipenv --python ${{ steps.setup-python.outputs.python-version }}
python3 -m pipx run pipenv install --dev --skip-lock
# It seems that `pipenv lock` does not understand markers. We have
# to `--skip-lock`.
- name: Package
run: |
python3 -m pipx run pipenv run clean
python3 -m pipx run pipenv run package
python3 -m pipx run pipenv run check-package
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}