Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/testing_main_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Automated testing and coverage (in protected branches)


on:
push:
branches: [ "main", "dev" ]
workflow_dispatch:


jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest coverage coverage-badge

- name: Run tests with coverage
run: |
coverage run --source=pv_tool -m pytest
coverage report -m
# if [ -f readme_images/coverage.svg ]; then rm readme_images/coverage.svg; fi
# coverage-badge -o readme_images/coverage.svg

# - name: Commit changes
# run: |
# git config --local user.email "action@github.com"
# git config --local user.name "GitHub Actions"
# git pull
# git add .
# if ! git diff --cached --quiet; then
# git commit -m "Testing and coverage"
# git push
# else
# echo "No changes to commit"
# fi
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/testing_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Automated testing and coverage (during pull request)


on:
pull_request:
branches: [ "dev" ]
workflow_dispatch:


jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest coverage coverage-badge

- name: Run tests with coverage
run: |
coverage run --source=pv_tool -m pytest
coverage report -m
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,3 @@ dmypy.json
data/output

# GitHub specific
.github/
Binary file modified example_files/Template_PVtool5_0.xlsx
Binary file not shown.
Binary file not shown.
Binary file added example_files/Template_PVtool5_0_backup.xlsx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading