Set up config for CI runs #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validator Bot | |
on: | |
pull_request: | |
branches: | |
- master | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
run-validation: | |
name: Run validation | |
runs-on: self-hosted | |
steps: | |
- uses: lkstrp/pypsa-validator@main | |
with: | |
step: run-self-hosted-validation | |
env_file: environment.yaml | |
snakemake_config: config/config.yaml | |
pre_command: "-call build_scenarios -f" | |
upload-artifacts: | |
name: Upload artifacts | |
needs: run-validation | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
include: | |
- {artifact_name: "results (feature branch)", path: "~/${{ github.repository }}/feature/results"} | |
- {artifact_name: "results (base branch)", path: "~/${{ github.repository }}/main/results"} | |
- {artifact_name: "validator-metadata", path: "~/${{ github.repository }}/validator-metadata.yml"} | |
steps: | |
- name: Upload artifacts - ${{ matrix.artifact_name }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact_name }} | |
path: | | |
${{ matrix.path }} | |
if-no-files-found: error | |
retention-days: 90 | |
comment-on-pr: | |
name: Comment on pull request | |
needs: upload-artifacts | |
runs-on: ubuntu-latest | |
steps: | |
- uses: lkstrp/pypsa-validator@main | |
with: | |
step: create-comment | |
snakemake_config: config/config.yaml | |
# The path starting from prefix in config | |
# For plot results/<prefix>/<scenario>/<plot_name>.png pass | |
# <scenario>/<plot_name>.png | |
plots: > | |
" | |
KN2045_Bal_v4/ariadne/primary_energy.png | |
KN2045_Bal_v4/ariadne/secondary_energy.png | |
KN2045_Bal_v4/ariadne/final_energy.png | |
" | |
repo_private_key: ${{ secrets.REPO_PLOTS_PRIVATE_KEY }} |