Skip to content

Commit

Permalink
Merge pull request #111 from PyPSA/ci-config
Browse files Browse the repository at this point in the history
Set up config for CI runs
  • Loading branch information
lindnemi authored Aug 6, 2024
2 parents e2e4149 + 15efdb1 commit f9096c2
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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 }}

0 comments on commit f9096c2

Please sign in to comment.