Define an API surface between Spezi Data Pipeline and Python notebook #54
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
# | |
# This source file is part of the Stanford Spezi open-source project | |
# | |
# SPDX-FileCopyrightText: 2024 Stanford University and the project authors (see CONTRIBUTORS.md) | |
# | |
# SPDX-License-Identifier: MIT | |
# | |
name: Build and Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
pylint: | |
name: Pylint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- name: Install Infrastructure | |
run: | | |
python -m pip install --upgrade pip | |
pip install pylint | |
- name: Install SpeziDataPipelineTemplate Dependencies | |
run: | | |
pip install pandas numpy matplotlib firebase-admin fhir.resources | |
- name: Analysing the code with pylint | |
run: | | |
pylint $(git ls-files '*.py') | |
build_and_test: | |
name: Build and Test Notebook | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'microsoft' | |
java-version: '17' | |
- name: Setup LaTex | |
run: | | |
sudo apt-get install pandoc texlive-xetex texlive-fonts-recommended texlive-plain-generic | |
- name: Cache Firebase Emulators | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/firebase/emulators | |
key: ${{ runner.os }}-${{ runner.arch }}-firebase-emulators-${{ hashFiles('~/.cache/firebase/emulators/**') }} | |
- name: Install Firebase CLI Tools | |
run: npm install -g firebase-tools | |
- name: Install Infrastructure | |
run: | | |
python -m pip install --upgrade pip | |
pip install jupyterlab | |
- name: Install SpeziDataPipelineTemplate Dependencies | |
run: | | |
pip install pandas numpy matplotlib firebase-admin fhir.resources | |
- name: Set Firestore Emulator Environment Variable | |
run: | | |
echo "FIRESTORE_EMULATOR_HOST=localhost:8080" >> $GITHUB_ENV | |
echo "GCLOUD_PROJECT=spezidatapipelinetemplate" >> $GITHUB_ENV | |
- name: Run Firebase Emulator & Execute Notebook | |
run: | | |
firebase emulators:exec --import=./sample_data "jupyter nbconvert --to pdf --execute SpeziDataPipelineTemplate.ipynb" | |
env: | |
CI: true | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: SpeziDataPipelineTemplate.pdf | |
path: SpeziDataPipelineTemplate.pdf |