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

GitHub workflows to update cm_model_catalog.md in views_pipeline #55

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
57 changes: 57 additions & 0 deletions .github/workflows/update_views_pipeline_cm_catalog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Update views_pipeline on Changes in cm_querysets.py and pgm_querysets.py

# Trigger on file changes in viewsforecasting
on:
push:
branches:
- main
- github_workflows # TODO: remove when merge to main
paths:
- Tools/cm_querysets.py
- Tools/pgm_querysets.py
workflow_dispatch: # enables manual triggering

jobs:
modify-views_pipeline:
runs-on: ubuntu-latest

steps:
- name: Checkout viewsforecasting repository
uses: actions/checkout@v3
with:
repository: prio-data/viewsforecasting
token: ${{ secrets.VIEWS_PIPELINE_ACCESS_TOKEN }}

- name: Clone views_pipeline repository
run: |
git clone https://github.com/prio-data/views_pipeline.git
cd views_pipeline
git status

- name: Clone viewsforecasting repository
run: |
git clone https://github.com/prio-data/viewsforecasting.git
cd viewsforecasting
git checkout github_workflows
# TODO: git checkout github_workflows should be removed when merged to main

- name: Run Python script
run: |
cd views_pipeline
git status
python documentation/catalogs/generate_links_to_querysets.py

- name: Configure Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"

- name: Commit and Push Changes
run: |
cd views_pipeline
git add documentation/catalogs/cm_model_catalog.md
git commit -m "Automated changes by GitHub Actions" || echo "Nothing to commit"
git push https://${{ secrets.VIEWS_PIPELINE_ACCESS_TOKEN }}:[email protected]/prio-data/views_pipeline.git



10 changes: 10 additions & 0 deletions Tools/cm_querysets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
import numpy as np
from viewser import Queryset, Column

'''



THIS IS SOME BLANK SPACE TO TEST THE GITHUB WORKFLOW



'''

def get_cm_querysets():


Expand Down
8 changes: 8 additions & 0 deletions Tools/pgm_querysets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
import numpy as np
from viewser import Queryset, Column

'''



THIS IS SOME BLANK SPACE TO TEST THE GITHUB WORKFLOW



'''
def report(df):
print()
print(f"A dataset with {len(df.columns)} columns, with "
Expand Down
Loading