Skip to content

Commit

Permalink
Merge branch 'main' into feat/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda authored Oct 16, 2024
2 parents 99b306a + 3298268 commit 5d9e3e1
Show file tree
Hide file tree
Showing 20 changed files with 284 additions and 275 deletions.
5 changes: 2 additions & 3 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down Expand Up @@ -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
7 changes: 3 additions & 4 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pull_request_rules:

- name: warn on conflicts
conditions:
- conflict
Expand All @@ -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:
Expand All @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci_install-pkg.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9

Expand All @@ -29,7 +29,7 @@ jobs:
- name: Verify package
run: |
pip install twine==3.2
pip install -r tests/requirements.txt
twine check dist/*
python setup.py clean
Expand Down
92 changes: 45 additions & 47 deletions .github/workflows/ci_testing.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,72 @@
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:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
python-version: ["3.7", "3.11"]
python-version: ["3.8", "3.11"]
# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- 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@v5
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@v4
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@v4
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
17 changes: 8 additions & 9 deletions .github/workflows/code-format.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
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:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install mypy
Expand All @@ -23,17 +22,17 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5

- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}

- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1
# this action also provides an additional behaviour when used in private repositories
# when configured with a github token, the action will push back fixes to the pull request branch
#with:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]
schedule:
- cron: "10 10 * * 6"

Expand All @@ -20,22 +20,22 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ python ]
language: [python]

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
12 changes: 6 additions & 6 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -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!"
52 changes: 26 additions & 26 deletions .github/workflows/release-pypi.yml
Original file line number Diff line number Diff line change
@@ -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]

Expand All @@ -13,30 +13,30 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
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 }}
Loading

0 comments on commit 5d9e3e1

Please sign in to comment.