Skip to content

TEST!!!! DO NOT MERGE #9

TEST!!!! DO NOT MERGE

TEST!!!! DO NOT MERGE #9

Workflow file for this run

name: "Run Python Tests"
on:
pull_request:
types: [opened, reopened, synchronize]
branches: [dev]
paths:
- "src/ecooptimizer/analyzers/**/*.py"
- "src/ecooptimizer/measurements/**/*.py"
- "src/ecooptimizer/refactorers/**/*.py"
- "src/ecooptimizer/utils/**/*.py"
- "src/ecooptimizer/testing/**/*.py"
jobs:
test:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Create app access token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.SCO_COMMIT_APP }}
private-key: ${{ secrets.SCO_APP_KEY }}
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install .'[dev]'
- name: Get changed modules
id: changed-modules
uses: tj-actions/changed-files@v45
with:
files: |
src/ecooptimizer/analyzers/**/*.py
src/ecooptimizer/measurements/**/*.py
src/ecooptimizer/refactorers/**/*.py
src/ecooptimizer/utils/**/*.py
src/ecooptimizer/testing/**/*.py
dir_names: True
- name: Run Pytest
if: steps.changed-modules.outputs.any_changed == 'true'
env:
ALL_CHANGED_MODULES: ${{ steps.changed-modules.outputs.all_changed_files }}
run: |
for module in ${ALL_CHANGED_MODULES}; do
folder="$(basename $module)"
pytest "tests/$folder/"
done