Pequeño cambio a neo4j. #13
This file contains hidden or 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
name: Run Neo4j Notebooks CI | |
on: | |
push: | |
branches: [ '*' ] | |
paths: | |
- 'neo4j/**' | |
pull_request: | |
branches: [ '*' ] | |
paths: | |
- 'neo4j/**' | |
jobs: | |
dump_contexts_to_log: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: Dump job context | |
env: | |
JOB_CONTEXT: ${{ toJson(job) }} | |
run: echo "$JOB_CONTEXT" | |
- name: Dump steps context | |
env: | |
STEPS_CONTEXT: ${{ toJson(steps) }} | |
run: echo "$STEPS_CONTEXT" | |
- name: Dump runner context | |
env: | |
RUNNER_CONTEXT: ${{ toJson(runner) }} | |
run: echo "$RUNNER_CONTEXT" | |
- name: Dump strategy context | |
env: | |
STRATEGY_CONTEXT: ${{ toJson(strategy) }} | |
run: echo "$STRATEGY_CONTEXT" | |
- name: Dump matrix context | |
env: | |
MATRIX_CONTEXT: ${{ toJson(matrix) }} | |
run: echo "$MATRIX_CONTEXT" | |
build-neo4j-notebooks: | |
runs-on: ubuntu-latest | |
env: | |
DB_HOSTNAME: "127.0.0.1" | |
services: | |
neo4j: | |
image: neo4j | |
ports: | |
- 7687:7687 | |
- 7474:7474 | |
volumes: | |
- /tmp/neo4j_import:/var/lib/neo4j/import | |
env: | |
NEO4J_AUTH: "none" | |
NEO4J_server_memory_heap_max__size: "8G" | |
NEO4J_db_import_csv_legacy__quote__escaping: "false" | |
options: --health-cmd "wget -qq http://localhost:7474" --health-interval 20s --health-timeout 5s --health-retries 5 | |
strategy: | |
matrix: | |
python: ["3.10", "3.12"] | |
notebook: ["neo4j/sesion7.ipynb"] | |
steps: | |
- name: Checkout the repo. | |
uses: actions/checkout@v4 | |
# Cambiado Notebook? | |
- name: ${{ matrix.notebook }} changed? | |
id: changed-file | |
uses: tj-actions/changed-files@v42 | |
with: | |
files: | | |
${{ matrix.notebook }} | |
- name: Setup Python | |
if: steps.changed-file.outputs.any_changed == 'true' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '${{ matrix.python }}' | |
cache: 'pip' | |
- name: Install dependencies | |
if: steps.changed-file.outputs.any_changed == 'true' | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install -r .github/workflows/requirements.txt | |
- name: Create output directory | |
if: steps.changed-file.outputs.any_changed == 'true' | |
run: mkdir -p ${{RUNNER.temp}}/nb-runner | |
env: | |
RUNNER: ${{ toJson(runner) }} | |
- name: Run notebook | |
if: steps.changed-file.outputs.any_changed == 'true' | |
run: | | |
papermill ${{ matrix.notebook }} ${{ matrix.notebook }}.output.ipynb | |
- name: Convert notebook to HTML | |
if: steps.changed-file.outputs.any_changed == 'true' | |
run: | | |
jupyter nbconvert --to html ${{ matrix.notebook }}.output.ipynb | |
cp ${{ matrix.notebook }}.output.* ${{RUNNER.temp}}/nb-runner | |
env: | |
RUNNER: ${{ toJson(runner) }} | |
- name: Convert notebook mame to artifact name to avoid colisions | |
if: steps.changed-file.outputs.any_changed == 'true' | |
id: notebook-no-slash | |
run: | | |
echo "value=`echo "${{ matrix.notebook }}" | tr '/. ' '---'`" >> "$GITHUB_OUTPUT" | |
- uses: actions/upload-artifact@v4 | |
if: steps.changed-file.outputs.any_changed == 'true' | |
with: | |
name: output-neo4j-${{ steps.notebook-no-slash.outputs.value }}-${{ matrix.python }} | |
path: ${{ RUNNER.temp }}/nb-runner | |
env: | |
RUNNER: ${{ toJson(runner) }} |