Updated build process #969
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
name: Pull Request test | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
get-changed-notebooks: | |
runs-on: ubuntu-latest | |
outputs: | |
changed_files: ${{ steps.output.outputs.changed_files }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v32 | |
with: | |
json: true | |
files: | | |
**/*.ipynb | |
files_ignore: | | |
**/sagemaker/** | |
**/Create_delete_projects.ipynb | |
**/utils/** | |
- 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-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
notebooks: ${{ fromJSON(needs.get-changed-notebooks.outputs.changed_files) }} | |
exclude: | |
- notebooks: integrations-and-supported-tools/sacred/notebooks/Neptune_Sacred.ipynb | |
python-version: "3.7" | |
- notebooks: integrations-and-supported-tools/detectron2/notebooks/Neptune_Detectron2.ipynb | |
os: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install OpenMP on MacOS for XGBoost integration | |
if: runner.os == 'macOS' | |
run: brew install libomp | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -U -r requirements.txt | |
- name: Test examples | |
uses: nick-fields/retry@v2 | |
env: | |
NEPTUNE_API_TOKEN: ${{ secrets.NEPTUNE_API_TOKEN }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
with: | |
timeout_minutes: 60 | |
max_attempts: 2 | |
retry_on: timeout | |
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@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get changed directories | |
id: changed-dirs | |
uses: tj-actions/changed-files@v34 | |
with: | |
dir_names: "true" | |
json: true | |
files: | | |
**/scripts/** | |
**/code/** | |
files_ignore: | | |
**/ddp-training/** | |
**/neptune-docker/** | |
**/kedro/** | |
**/utils/** | |
- 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-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
dir: ${{ fromJSON(needs.get-changed-scripts.outputs.changed_dirs) }} | |
exclude: | |
- dir: integrations-and-supported-tools/sacred/scripts | |
python-version: "3.7" | |
- dir: integrations-and-supported-tools/detectron2/scripts | |
os: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install OpenMP on MacOS for XGBoost integration | |
if: runner.os == 'macOS' | |
run: brew install libomp | |
- name: Test examples | |
uses: nick-fields/retry@v2 | |
env: | |
NEPTUNE_API_TOKEN: ${{ secrets.NEPTUNE_API_TOKEN }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
with: | |
timeout_minutes: 60 | |
max_attempts: 2 | |
retry_on: timeout | |
command: | | |
echo "Running ${{ matrix.dir }}/run_examples.sh" | |
cd ${{ matrix.dir }} | |
bash run_examples.sh | |
get-changed-docker: | |
runs-on: ubuntu-latest | |
outputs: | |
changed_files: ${{ steps.output.outputs.changed_files }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v32 | |
with: | |
files: how-to-guides/neptune-docker/scripts/* | |
- name: Set output | |
id: output | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: echo "changed_files='${{ steps.changed-files.outputs.any_modified }}" >> "$GITHUB_OUTPUT" | |
test-docker-example: | |
needs: get-changed-docker | |
if: ${{ needs.get-changed-docker.outputs.changed_files }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: build docker container from Dockerfile | |
run: docker build -f how-to-guides/neptune-docker/scripts/Dockerfile --tag neptune-docker . | |
- name: run docker container | |
timeout-minutes: 20 | |
run: docker run -e NEPTUNE_API_TOKEN=${{ secrets.NEPTUNE_API_TOKEN }} neptune-docker | |
get-changed-kedro: | |
runs-on: ubuntu-latest | |
outputs: | |
changed_files: ${{ steps.output.outputs.changed_files }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v32 | |
with: | |
files: integrations-and-supported-tools/kedro/* | |
- name: Set output | |
id: output | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: echo "changed_files='${{ steps.changed-files.outputs.any_modified }}" >> "$GITHUB_OUTPUT" | |
test-kedro-example: | |
needs: get-changed-kedro | |
if: ${{ needs.get-changed-kedro.outputs.changed_files }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Test kedro scripts | |
working-directory: integrations-and-supported-tools/kedro/scripts | |
timeout-minutes: 20 | |
env: | |
NEPTUNE_API_TOKEN: ${{ secrets.NEPTUNE_API_TOKEN }} | |
run: bash ./run_examples.sh |