diff --git a/.codecov.yml b/.codecov.yml index 141653a..bd4cbd4 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -2,7 +2,6 @@ # Validation check: # $ curl --data-binary @.codecov.yml https://codecov.io/validate - # https://docs.codecov.io/docs/codecovyml-reference codecov: bot: "codecov-io" @@ -12,7 +11,7 @@ codecov: wait_for_ci: yes coverage: - precision: 0 # 2 = xx.xx%, 0 = xx% + precision: 0 # 2 = xx.xx%, 0 = xx% round: nearest # how coverage is rounded: down/up/nearest range: 60...100 # custom range of coverage colors from red -> yellow -> green status: @@ -44,4 +43,4 @@ parsers: comment: layout: header, diff require_changes: false - behavior: default # update if exists else create new + behavior: default # update if exists else create new diff --git a/.github/mergify.yml b/.github/mergify.yml index 09745e9..0372065 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -1,5 +1,4 @@ pull_request_rules: - - name: warn on conflicts conditions: - conflict @@ -9,7 +8,7 @@ pull_request_rules: # comment: # message: This pull request is now in conflict... :( label: - add: [ "has conflicts" ] + add: ["has conflicts"] - name: resolved conflicts conditions: @@ -20,13 +19,13 @@ pull_request_rules: - -closed actions: label: - remove: [ "has conflicts" ] + remove: ["has conflicts"] - name: update PR conditions: - -conflict - -draft # filter-out GH draft PRs - - base=master # apply only on master + - base=master # apply only on master - -title~=(?i)wip # skip all PR that title contains “WIP” (ignoring case) - "#approved-reviews-by>=1" # number of review approvals actions: diff --git a/.github/workflows/ci_install-pkg.yml b/.github/workflows/ci_install-pkg.yml index d7121c7..d5fc3a1 100644 --- a/.github/workflows/ci_install-pkg.yml +++ b/.github/workflows/ci_install-pkg.yml @@ -1,10 +1,10 @@ name: Install pkg # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows -on: # Trigger the workflow on push or pull request, but only for the main branch +on: # Trigger the workflow on push or pull request, but only for the main branch push: {} pull_request: - branches: [ main ] + branches: [main] jobs: pkg-check: diff --git a/.github/workflows/ci_testing.yml b/.github/workflows/ci_testing.yml index 38064c9..562ae11 100644 --- a/.github/workflows/ci_testing.yml +++ b/.github/workflows/ci_testing.yml @@ -1,13 +1,12 @@ name: CI testing # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows -on: # Trigger the workflow on push or pull request, but only for the main branch +on: # Trigger the workflow on push or pull request, but only for the main branch push: {} pull_request: - branches: [ main ] + branches: [main] jobs: - pytester: runs-on: ${{ matrix.os }} strategy: @@ -18,57 +17,56 @@ jobs: # Timeout: https://stackoverflow.com/a/59076067/4521646 timeout-minutes: 10 steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install requirements - run: | - pip install -r tests/requirements.txt - pip list - shell: bash + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} - - name: Tests - run: | - phmdoctest README.md --outfile tests/test_readme.py - python -m pytest . -v --cov=deprecate --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml + - name: Install requirements + run: | + pip install -r tests/requirements.txt + pip list + shell: bash - - name: Upload pytest test results - uses: actions/upload-artifact@v3 - with: - name: pytest-results-${{ runner.os }}-${{ matrix.python-version }} - path: junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml - if: failure() + - name: Tests + run: | + phmdoctest README.md --outfile tests/test_readme.py + python -m pytest . -v --cov=deprecate --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml - - name: Statistics - if: success() - run: | - coverage report - coverage xml + - name: Upload pytest test results + uses: actions/upload-artifact@v3 + with: + name: pytest-results-${{ runner.os }}-${{ matrix.python-version }} + path: junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml + if: failure() - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - if: success() - continue-on-error: true - with: - # token: ${{ secrets.CODECOV_TOKEN }} - file: coverage.xml - flags: pytest,python${{ matrix.python-version }} - fail_ci_if_error: false + - name: Statistics + if: success() + run: | + coverage report + coverage xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + if: success() + continue-on-error: true + with: + # token: ${{ secrets.CODECOV_TOKEN }} + file: coverage.xml + flags: pytest,python${{ matrix.python-version }} + fail_ci_if_error: false testing-guardian: runs-on: ubuntu-latest needs: pytester if: always() steps: - - run: echo "${{ needs.pytester.result }}" - - name: failing... - if: needs.pytester.result == 'failure' - run: exit 1 - - name: cancelled or skipped... - if: contains(fromJSON('["cancelled", "skipped"]'), needs.pytester.result) - timeout-minutes: 1 - run: sleep 90 + - run: echo "${{ needs.pytester.result }}" + - name: failing... + if: needs.pytester.result == 'failure' + run: exit 1 + - name: cancelled or skipped... + if: contains(fromJSON('["cancelled", "skipped"]'), needs.pytester.result) + timeout-minutes: 1 + run: sleep 90 diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index c15075d..05472a1 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -1,13 +1,12 @@ name: Code formatting # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows -on: # Trigger the workflow on push or pull request, but only for the main branch +on: # Trigger the workflow on push or pull request, but only for the main branch push: {} pull_request: - branches: [ main ] + branches: [main] jobs: - typing-mypy: runs-on: ubuntu-20.04 steps: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a7ff000..eaf366b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,9 +2,9 @@ name: "CodeQL" on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] schedule: - cron: "10 10 * * 6" @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ python ] + language: [python] steps: - name: Checkout diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 0b4be67..a4d5d27 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -1,14 +1,14 @@ name: Greetings # https://github.com/marketplace/actions/first-interaction -on: [issues] # pull_request +on: [issues] # pull_request jobs: greeting: runs-on: ubuntu-latest steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Hi! thanks for your contribution!, great first issue!' - pr-message: 'Hey thanks for the input! Please give us a bit of time to review it!' + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: "Hi! thanks for your contribution!, great first issue!" + pr-message: "Hey thanks for the input! Please give us a bit of time to review it!" diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml index c1066ed..4f3109d 100644 --- a/.github/workflows/release-pypi.yml +++ b/.github/workflows/release-pypi.yml @@ -1,9 +1,9 @@ name: PyPI Release # https://help.github.com/en/actions/reference/events-that-trigger-workflows -on: # Trigger the workflow on push or pull request, but only for the main branch +on: # Trigger the workflow on push or pull request, but only for the main branch push: - branches: [ main ] + branches: [main] release: types: [published] @@ -13,30 +13,30 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: 3.8 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: 3.8 - - name: Install dependencies - run: python -m pip install build - - name: Build package - run: python -m build - - name: List package - run: ls -lh dist/ + - name: Install dependencies + run: python -m pip install build + - name: Build package + run: python -m build + - name: List package + run: ls -lh dist/ - # We do this, since failures on test.pypi aren't that bad - - name: Publish to Test PyPI - if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.test_pypi_password }} - repository_url: https://test.pypi.org/legacy/ + # We do this, since failures on test.pypi aren't that bad + - name: Publish to Test PyPI + if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.test_pypi_password }} + repository_url: https://test.pypi.org/legacy/ - - name: Publish distribution 📦 to PyPI - if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_password }} + - name: Publish distribution 📦 to PyPI + if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 25ea6b0..8338ef7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ default_language_version: ci: autofix_prs: true - autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions' + autoupdate_commit_msg: "[pre-commit.ci] pre-commit suggestions" autoupdate_schedule: quarterly # submodules: true