Skip to content

Commit

Permalink
👷🏻 Adding Mutation Testing to CI/CD Process (#27)
Browse files Browse the repository at this point in the history
* Adding mutation tests to pipeline

* Updating gitignore for mutmut files

* Updating mutmut to not show progress during pipeline run

* Updating mutmut to use CI options

* Setting pipeline to be 3.11

* Update action versions to v4

* Using cache action to access across build

* Updating cache emoji

* Fixing caching actions

* Fixing branch name

* Fixing typo

* Trying different environment variable

* Update emoji

* Fixing key path

* Using hash of files for cache key

* Fixing hash path

* Fixing save path

* Update cicd.yaml

* Update cicd.yaml

* Update cicd.yaml

* Rename mutation testing stage
  • Loading branch information
jossmoff authored Nov 11, 2023
1 parent 09e9c6d commit b99bcac
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:

steps:
- name: 🔄 Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: 🐍 Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.x # Specify your desired Python version
python-version: 3.11

- name: 📦 Install dependencies
run: pip install -r requirements-dev.txt # Replace with your requirements file
Expand All @@ -31,4 +31,27 @@ jobs:
- name: ☂️ Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: 🗃️ Uncache Mutation Testing Artifacts
uses: actions/cache/restore@v3
with:
path: .mutmut-cache
key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('bookshelf/*.py') }}

- name: 🦠 Run Mutation Tests
run: |
mutmut run --no-progress --CI
mutmut html
- name: 📤 Upload Mutation Test Report
uses: actions/upload-artifact@v2
with:
name: mutmut-html-report
path: html/bookshelf

- name: 🗃️ Cache Mutation Test Cache
uses: actions/cache/save@v3
with:
path: .mutmut-cache
key: ${{ runner.os }}-mutmut-cache-${{ hashFiles('bookshelf/*.py') }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,7 @@ docs/.env
docs/.env.production

# macOS-specific files
docs/.DS_Store
docs/.DS_Store

html/
.mutmut-cache
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ assertpy~=1.1.0
pytest==7.4.3
pytest-cov==4.1.0
setuptools==68.2.2
flake8~=6.1.0
flake8~=6.1.0
mutmut~=2.4.4

0 comments on commit b99bcac

Please sign in to comment.