Skip to content

Commit

Permalink
feat: add validator action
Browse files Browse the repository at this point in the history
  • Loading branch information
lkstrp committed Jul 29, 2024
1 parent 7c3ec17 commit e5a8d4d
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Validator Bot

on:
pull_request:
branches:
- master
- main

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: "~/pypsa-ariadne/feature/results"}
- {artifact_name: "results (base branch)", path: "~/pypsa-ariadne/main/results"}
- {artifact_name: "validator-metadata", path: "~/pypsa-ariadne/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
plots: >
"
/biomass_industry/KN2045_Bal_v4/ariadne/capacity.png
/biomass_industry/KN2045_Bal_v4/ariadne/final_energy.png
/biomass_industry/KN2045_Bal_v4/ariadne/policy_carbon.png
"
repo_private_key: ${{ secrets.REPO_PLOTS_PRIVATE_KEY }}

0 comments on commit e5a8d4d

Please sign in to comment.