-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (86 loc) · 3.15 KB
/
_dispatcher.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# This file is the dispatcher for the rest of the workflows that have complex dependencies.
# The `cli.yml` doesn't need to be dispatched via this dispatcher because it is only run manually.
name: Dispatcher
env:
GITHUB_OUTPUT: ""
on:
push:
branches:
- main
paths:
- "docker/**"
- ".github/**"
- "!.github/workflows/cli.yml"
- "!docker/psibase.Dockerfile"
- "!docker/psinode.Dockerfile"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "docker/**"
- ".github/**"
- "!.github/workflows/cli.yml"
- "!docker/psibase.Dockerfile"
- "!docker/psinode.Dockerfile"
jobs:
determine-actions:
name: Set up the dispatching variables
runs-on: ubuntu-latest
outputs:
run_tc: ${{ steps.schedule-builders.outputs.run_tc }}
run_2204: ${{ steps.schedule-builders.outputs.run_2204 }}
run_2404: ${{ steps.schedule-builders.outputs.run_2404 }}
run_contrib: ${{ steps.schedule-builders.outputs.run_contrib }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
- name: (Debug) Print changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in $ALL_CHANGED_FILES; do
echo $file
done
- name: Determine what to dispatch
id: schedule-builders
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
necessary_jobs=$(./.github/scripts/check-patterns.sh "$ALL_CHANGED_FILES")
read -r run_tc run_2204 run_2404 run_contrib <<< "$necessary_jobs"
echo "run_tc=${run_tc}" | tee -a $GITHUB_OUTPUT
echo "run_2204=${run_2204}" | tee -a $GITHUB_OUTPUT
echo "run_2404=${run_2404}" | tee -a $GITHUB_OUTPUT
echo "run_contrib=${run_contrib}" | tee -a $GITHUB_OUTPUT
build-tool-config:
name: "Build tool config"
needs: determine-actions
if: ${{ needs.determine-actions.outputs.run_tc == '1' }}
uses: ./.github/workflows/tool-config.yml
build-2204:
name: "Build 22.04 builder"
needs: determine-actions
if: ${{ needs.determine-actions.outputs.run_2204 == '1' }}
uses: ./.github/workflows/builder-ubuntu.yml
with:
ubuntu_version: "2204"
build-2404:
name: "Build 24.04 builder"
needs: determine-actions
if: ${{ needs.determine-actions.outputs.run_2404 == '1' }}
uses: ./.github/workflows/builder-ubuntu.yml
with:
ubuntu_version: "2404"
build-contributor:
name: "Build contributor"
needs: [determine-actions, build-tool-config, build-2204]
if: ${{ !cancelled() && needs.determine-actions.outputs.run_contrib == '1' }}
uses: ./.github/workflows/contributor.yml
with:
new_tools: ${{ needs.build-tool-config.result == 'success'}}
new_base: ${{ needs.build-2204.result == 'success'}}