diff --git a/.github/workflows/contributed-recipes.yml b/.github/workflows/contributed-recipes.yml index ce548c6a..d51bf3e4 100644 --- a/.github/workflows/contributed-recipes.yml +++ b/.github/workflows/contributed-recipes.yml @@ -20,8 +20,21 @@ on: workflow_call: jobs: + generate-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout Repo ⚡️ + uses: actions/checkout@v3 + + - name: Calculate recipes matrix 🛠 + id: set-matrix + run: docs/using/recipe_code/generate_matrix.py >> $GITHUB_OUTPUT + test-recipes: runs-on: ubuntu-latest + needs: generate-matrix if: github.repository == 'jupyter/docker-stacks' steps: @@ -38,18 +51,4 @@ jobs: shell: bash strategy: - matrix: - dockerfile: - [ - custom_environment.dockerfile, - dask_jupyterlab.dockerfile, - jupyterhub_version.dockerfile, - mamba_install.dockerfile, - manpage_install.dockerfile, - microsoft_odbc.dockerfile, - oracledb.dockerfile, - pip_install.dockerfile, - rise_jupyterlab.dockerfile, - spellcheck_notebookv6.dockerfile, - xgboost.dockerfile, - ] + matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}} diff --git a/docs/contributing/recipes.md b/docs/contributing/recipes.md index 98572c0f..d44ac242 100644 --- a/docs/contributing/recipes.md +++ b/docs/contributing/recipes.md @@ -6,7 +6,7 @@ Follow the process below to add a new recipe: 1. Open the `docs/using/recipes.md` source file. 2. Add a second-level Markdown heading naming your recipe at the bottom of the file (e.g., `## Slideshows with JupyterLab and RISE`) 3. Write the body of your recipe under the heading, including whatever command line, links, etc. you need. -4. If you have a Dockerfile, please put it in a `recipe_code` subdirectory - and update [contributed-recipes workflow](https://github.com/jupyter/docker-stacks/blob/main/.github/workflows/contributed-recipes.yml) to include your file. +4. If you have a Dockerfile, please put it in a `recipe_code` subdirectory. + This file will be built automatically by [contributed-recipes workflow](https://github.com/jupyter/docker-stacks/blob/main/.github/workflows/contributed-recipes.yml). 5. [Submit a pull request](https://github.com/PointCloudLibrary/pcl/wiki/A-step-by-step-guide-on-preparing-and-submitting-a-pull-request) (PR) with your changes. Maintainers will respond and work with you to address any formatting or content issues. diff --git a/docs/using/recipe_code/generate_matrix.py b/docs/using/recipe_code/generate_matrix.py new file mode 100755 index 00000000..ff588029 --- /dev/null +++ b/docs/using/recipe_code/generate_matrix.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. +import json +from pathlib import Path +from typing import Any + +THIS_DIR = Path(__file__).parent.resolve() + + +def generate_matrix() -> dict[str, Any]: + dockerfiles = sorted(file.name for file in THIS_DIR.glob("*.dockerfile")) + return {"dockerfile": dockerfiles} + + +if __name__ == "__main__": + print("matrix=" + json.dumps(generate_matrix()))