Skip to content

Update README.md

Update README.md #3

Workflow file for this run

name: Pull Request test
on:
pull_request:
branches:
- main
workflow_dispatch:
env:
PYTHONIOENCODING: utf-8
PYTHONLEGACYWINDOWSSTDIO: utf-8
NEPTUNE_PROJECT: ${{ vars.NEPTUNE_PROJECT }}
jobs:
get-changed-notebooks:
runs-on: ubuntu-latest
outputs:
changed_files: ${{ steps.output.outputs.changed_files }}
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
json: true
files: |
**/*.ipynb
- name: Set output
id: output
if: steps.changed-files.outputs.any_changed == 'true'
run: echo "changed_files=${{ steps.changed-files.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT"
test-notebooks:
needs: get-changed-notebooks
if: ${{ needs.get-changed-notebooks.outputs.changed_files }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
notebooks: ${{ fromJSON(needs.get-changed-notebooks.outputs.changed_files) }}
steps:
- uses: actions/checkout@main
- uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U -r requirements.txt
- name: Install setuptools for python>=3.12
if: matrix.python-version >= 3.12
run: pip install -U setuptools
- name: Install libomp on MacOS
if: matrix.os == 'macos-13'
run: brew install libomp
- name: Test examples
uses: nick-fields/retry@v3
env:
NEPTUNE_API_TOKEN: ${{ secrets.NEPTUNE_API_TOKEN }}
with:
timeout_minutes: 60
max_attempts: 2
command: |
echo "Running ${{ matrix.notebooks }}"
ipython ${{ matrix.notebooks }}
get-changed-scripts:
runs-on: ubuntu-latest
outputs:
changed_dirs: ${{ steps.output.outputs.changed_dirs }}
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Get changed directories
id: changed-dirs
uses: tj-actions/changed-files@v41
with:
dir_names: "true"
json: true
files: |
**/scripts/**
**/code/**
- name: Set output
id: output
if: steps.changed-dirs.outputs.any_changed == 'true'
run: echo "changed_dirs=${{ steps.changed-dirs.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT"
test-scripts:
needs: get-changed-scripts
if: ${{ needs.get-changed-scripts.outputs.changed_dirs }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
dir: ${{ fromJSON(needs.get-changed-scripts.outputs.changed_dirs) }}
steps:
- uses: actions/checkout@main
- uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install setuptools for python>=3.12
if: matrix.python-version >= 3.12
run: pip install -U setuptools
- name: Install libomp on MacOS
if: matrix.os == 'macos-13'
run: brew install libomp
- name: Test examples
uses: nick-fields/retry@v3
env:
NEPTUNE_API_TOKEN: ${{ secrets.NEPTUNE_API_TOKEN }}
with:
timeout_minutes: 60
max_attempts: 2
command: |
echo "Running ${{ matrix.dir }}/run_examples.sh"
cd ${{ matrix.dir }}
bash run_examples.sh