-
Notifications
You must be signed in to change notification settings - Fork 3k
74 lines (66 loc) · 2.28 KB
/
contributed-recipes.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Test the contributed recipes
on:
schedule:
# Images are rebuilt at 03:00 on Monday UTC
# So we're testing recipes one hour in advance
# They will also be tested after building images
- cron: "0 2 * * 1"
pull_request:
paths:
- ".github/workflows/contributed-recipes.yml"
- "docs/using/recipe_code/**"
push:
branches:
- main
paths:
- ".github/workflows/contributed-recipes.yml"
- "docs/using/recipe_code/**"
workflow_dispatch:
workflow_call:
inputs:
# There is no good way to detect if the workflow was called using workflow_call
# https://github.com/actions/runner/discussions/1884
called-using-workflow-call:
description: "Was the workflow called using workflow_call"
required: true
type: boolean
jobs:
generate-matrix:
runs-on: ubuntu-24.04
timeout-minutes: 1
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout Repo ⚡️
uses: actions/checkout@v4
- name: Calculate recipes matrix 🛠
id: set-matrix
run: docs/using/recipe_code/generate_matrix.py >> "${GITHUB_OUTPUT}"
env:
REPOSITORY_OWNER: ${{ github.repository_owner }}
test-recipes:
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 5
needs: generate-matrix
if: github.repository_owner == 'jupyter' || github.repository_owner == 'mathbunnyru'
steps:
- name: Checkout Repo ⚡️
uses: actions/checkout@v4
- name: Load image to Docker 📥
if: ${{ inputs.called-using-workflow-call && matrix.parent-image != '' }}
uses: ./.github/actions/load-image
with:
image: ${{ matrix.parent-image }}
platform: ${{ matrix.platform }}
variant: default
# Not pulling the image, because it might be loaded from previous step or will be downloaded automatically
- name: Build recipe 🛠
run: docker build --rm --force-rm --tag my-custom-image -f ./${{ matrix.dockerfile }} ./
env:
DOCKER_BUILDKIT: 1
# Full logs for CI build
BUILDKIT_PROGRESS: plain
working-directory: docs/using/recipe_code
shell: bash
strategy:
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}