|
| 1 | +name: Test Tutorial Pipelines |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Run daily at 9 AM UTC |
| 6 | + - cron: "0 9 * * *" |
| 7 | + push: |
| 8 | + branches: [main, develop] |
| 9 | + pull_request: |
| 10 | + branches: [main, develop] |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +jobs: |
| 14 | + test-pipelines: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + env: |
| 17 | + ZENML_ANALYTICS_OPT_IN: false |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Set up Python |
| 24 | + uses: actions/setup-python@v4 |
| 25 | + with: |
| 26 | + python-version: "3.11" |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: | |
| 30 | + python -m pip install --upgrade pip |
| 31 | + pip install zenml[server] --upgrade |
| 32 | + pip install -r requirements.txt |
| 33 | +
|
| 34 | + - name: Initialize ZenML |
| 35 | + run: | |
| 36 | + zenml init |
| 37 | + zenml integration install aws s3 -y |
| 38 | +
|
| 39 | + - name: Run all tutorial pipelines |
| 40 | + id: run_all |
| 41 | + run: | |
| 42 | + failed=() |
| 43 | + for p in \ |
| 44 | + "pipelines/helloWorld/hello_pipeline.py" \ |
| 45 | + "pipelines/caching/cache_pipeline.py" \ |
| 46 | + "pipelines/fanOut/fan_pipeline.py" \ |
| 47 | + "pipelines/metadata/meta_pipeline.py" \ |
| 48 | + "pipelines/parameters/param_pipeline.py" \ |
| 49 | + "pipelines/retries/robust_pipeline.py" \ |
| 50 | + "pipelines/stepIO/io_pipeline.py" \ |
| 51 | + "pipelines/tagging/tagged_pipeline.py" \ |
| 52 | + "pipelines/visualizations/viz_pipeline.py" \ |
| 53 | + "pipelines/yamlConfig/yaml_pipeline.py"; do |
| 54 | +
|
| 55 | + echo "Running $p…" |
| 56 | + if [[ "$p" == *"retries/robust_pipeline.py" ]]; then |
| 57 | + PYTHONPATH=$GITHUB_WORKSPACE:$PYTHONPATH python "$p" || echo "⚠ robust_pipeline demo: failure expected" |
| 58 | + else |
| 59 | + PYTHONPATH=$GITHUB_WORKSPACE:$PYTHONPATH python "$p" || failed+=("$p") |
| 60 | + fi |
| 61 | + done |
| 62 | +
|
| 63 | + if [ "${#failed[@]}" -gt 0 ]; then |
| 64 | + echo "Failed pipelines:" |
| 65 | + printf " - %s\n" "${failed[@]}" |
| 66 | + exit 1 |
| 67 | + fi |
| 68 | +
|
| 69 | + notify-discord: |
| 70 | + needs: test-pipelines |
| 71 | + if: ${{ failure() }} |
| 72 | + runs-on: ubuntu-latest |
| 73 | + |
| 74 | + steps: |
| 75 | + - name: Send Discord notification on failure |
| 76 | + uses: Ilshidur/action-discord@master |
| 77 | + env: |
| 78 | + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_SRE }} |
| 79 | + with: |
| 80 | + args: | |
| 81 | + **Pipeline Test Failure Alert** |
| 82 | +
|
| 83 | + Repository: ${{ github.repository }} |
| 84 | + Branch: ${{ github.ref_name }} |
| 85 | + Workflow: ${{ github.workflow }} |
| 86 | + Run ID: ${{ github.run_id }} |
| 87 | +
|
| 88 | + One or more tutorial pipelines failed with the latest ZenML version. |
| 89 | + Details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
0 commit comments