Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up config for CI runs #111

Merged
merged 2 commits into from
Aug 6, 2024
Merged
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
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 }}