diff --git a/.github/workflows/python-mutmut.yml b/.github/workflows/mutmut-mutation-test.yml similarity index 67% rename from .github/workflows/python-mutmut.yml rename to .github/workflows/mutmut-mutation-test.yml index b1fb5e2..1c95c19 100644 --- a/.github/workflows/python-mutmut.yml +++ b/.github/workflows/mutmut-mutation-test.yml @@ -1,4 +1,4 @@ -name: Python Mutation Test +name: Mutmut on: workflow_dispatch: @@ -17,20 +17,26 @@ jobs: python3 -m pip install --upgrade pip pip install -r requirements.txt --upgrade pip install mutmut --upgrade - pip install --editable . - - name: Mutmut - run: python3 -m mutmut run --no-progress --rerun-all --paths-to-mutate src --runner "pytest --exitfirst --assert=plain --sort-mode=diffcov" || true - - run: python3 -m mutmut results + - name: Mutmut Run + run: python3 -m mutmut run --no-progress --rerun-all --paths-to-mutate src + - name: Mutmut Results if: ${{ always() }} + run: python3 -m mutmut results - name: Mutmut Report if: ${{ always() }} run: | python3 -m mutmut html python3 -m mutmut junitxml > mutation-testing-report.xml head mutation-testing-report.xml -n 3 - - name: save-reports + - name: Upload Report HTML if: ${{ always() }} uses: actions/upload-artifact@v3 with: - name: Mutation testing report + name: Mutation testing report HTML path: html + - name: Upload Report XML + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: Mutation testing report XML + path: mutation-testing-report.xml diff --git a/.github/workflows/python-mutation-test.yml b/.github/workflows/poodle-mutation-test.yml similarity index 52% rename from .github/workflows/python-mutation-test.yml rename to .github/workflows/poodle-mutation-test.yml index 51de978..0a85217 100644 --- a/.github/workflows/python-mutation-test.yml +++ b/.github/workflows/poodle-mutation-test.yml @@ -1,14 +1,12 @@ -name: Python Mutation Test +name: Poodle Mutation Test on: workflow_dispatch: -concurrency: updates-project - jobs: poodle: name: Mutation Test with Poodle - runs-on: [macos-latest] + runs-on: [ubuntu-latest] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 @@ -19,11 +17,5 @@ jobs: python3 -m pip install --upgrade pip pip install -r requirements.txt --upgrade pip install --editable . - - name: Poodle - run: poodle --report json || true - - name: save-json-report - if: ${{ github.ref_name == 'main' }} - uses: EndBug/add-and-commit@v9 - with: - add: "mutation-testing-report.json" - pull: "--rebase=true --autostash" + - run: poodle + diff --git a/.github/workflows/python-test-matrix.yml b/.github/workflows/python-platform-test.yml similarity index 96% rename from .github/workflows/python-test-matrix.yml rename to .github/workflows/python-platform-test.yml index 8e7ea68..e28737d 100644 --- a/.github/workflows/python-test-matrix.yml +++ b/.github/workflows/python-platform-test.yml @@ -4,11 +4,12 @@ on: push: paths: - .github/workflows/python-test-matrix.yml - pull_request: - paths: - requirements.txt - src/** - tests/** + pull_request: + branches-ignore: + - docs workflow_dispatch: jobs: diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index e798bcf..064e3cf 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -13,10 +13,8 @@ on: types: [published] workflow_dispatch: -concurrency: updates-project - permissions: - contents: write + contents: read jobs: deploy: @@ -37,23 +35,7 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt --upgrade pip install build setuptools twine --upgrade - - name: Read Version - uses: SebRollen/toml-action@v1.0.2 - id: read_vesion - with: - file: 'pyproject.toml' - field: 'project.version' - - name: Set version in code - run: | - echo "Setting version to ${{ steps.read_vesion.outputs.value }}" - sed -i 's/__version__ = "[0-9]\+\.[0-9]\+\.[0-9]\+"/__version__ = "${{ steps.read_vesion.outputs.value }}"/g' src/poodle/__init__.py - - name: commit-version - uses: EndBug/add-and-commit@v9 - with: - add: "src/poodle/__init__.py" - pull: "--rebase=true --autostash" - name: Build package run: python -m build - name: Publish package - if: ${{ github.ref_name == 'main' }} uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/python-test-scan.yml b/.github/workflows/python-test-scan.yml index 39ff0b4..4093542 100644 --- a/.github/workflows/python-test-scan.yml +++ b/.github/workflows/python-test-scan.yml @@ -4,15 +4,14 @@ on: push: paths: - .github/workflows/python-test-scan.yml - pull_request: - paths: - requirements.txt - src/** - tests/** + pull_request: + branches-ignore: + - docs workflow_dispatch: -concurrency: updates-project - jobs: pytest-cov: name: Unit Test with Pytest @@ -27,17 +26,16 @@ jobs: python3 -m pip install --upgrade pip pip install -r requirements.txt --upgrade - run: pytest --cov=src --cov-report=json:code-coverage.json - - name: commit-json-report - if: ${{ github.ref_name == 'main' }} - uses: EndBug/add-and-commit@v9 - with: - add: "code-coverage.json" - pull: "--rebase=true --autostash" - name: artifact-html-report uses: actions/upload-artifact@v3 with: - name: Coverage Report + name: Coverage Report HTML path: cov-html + - name: artifact-json-report + uses: actions/upload-artifact@v3 + with: + name: Coverage Report JSON + path: code-coverage.json isort: name: Import Checks with ISort runs-on: [ubuntu-latest] diff --git a/.github/workflows/update-coverage.yml b/.github/workflows/update-coverage.yml new file mode 100644 index 0000000..0473aed --- /dev/null +++ b/.github/workflows/update-coverage.yml @@ -0,0 +1,56 @@ +name: Update Coverage Reports + +on: + push: + branches: + - main + workflow_dispatch: + +concurrency: updates-project + +jobs: + pytest-coverage: + name: Pytest Coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: '3.12' + - name: Install Dependencies and Tools + run: | + python3 -m pip install --upgrade pip + pip install -r requirements.txt --upgrade + - run: pytest --cov=src --cov-report=json:code-coverage.json + - name: commit-json-report + if: ${{ github.ref_name == 'main' }} + uses: EndBug/add-and-commit@v9 + with: + add: "code-coverage.json" + pull: "--rebase=true --autostash" + - name: artifact-html-report + uses: actions/upload-artifact@v3 + with: + name: Coverage Report + path: cov-html + poodle: + name: Mutation Coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: '3.12' + - name: Install Dependencies and Tools + run: | + python3 -m pip install --upgrade pip + pip install -r requirements.txt --upgrade + pip install --editable . + - name: Poodle + run: poodle --report json || true + - name: save-json-report + if: ${{ github.ref_name == 'main' }} + uses: EndBug/add-and-commit@v9 + with: + add: "mutation-testing-report.json" + pull: "--rebase=true --autostash" diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml new file mode 100644 index 0000000..271fc59 --- /dev/null +++ b/.github/workflows/update-version.yml @@ -0,0 +1,33 @@ +name: Update Version from pyproject.toml + +on: + push: + paths: + - 'pyproject.toml' + branches-ignore: + - docs + workflow_dispatch: + +concurrency: updates-project + +jobs: + update-version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Read Version + uses: SebRollen/toml-action@v1.0.2 + id: read_vesion + with: + file: 'pyproject.toml' + field: 'project.version' + - name: Set version in code + run: | + echo "Setting version to ${{ steps.read_vesion.outputs.value }}" + sed -i 's/__version__ = "[0-9]\+\.[0-9]\+\.[0-9]\+"/__version__ = "${{ steps.read_vesion.outputs.value }}"/g' src/poodle/__init__.py + - name: commit-version + uses: EndBug/add-and-commit@v9 + with: + add: "src/poodle/__init__.py" + pull: "--rebase=true --autostash" +