forked from y-scope/clp
-
Notifications
You must be signed in to change notification settings - Fork 1
158 lines (143 loc) · 5.23 KB
/
clp-core-build.yaml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: "clp-core-build"
on:
pull_request:
paths:
- ".github/actions/**"
- ".github/workflows/clp-core-build.yaml"
- "components/core/**"
- "!components/core/tools/scripts/lib_install/macos-12/**"
push:
paths:
- ".github/actions/**"
- ".github/workflows/clp-core-build.yaml"
- "components/core/**"
- "!components/core/tools/scripts/lib_install/macos-12/**"
workflow_dispatch:
env:
# Consider changes between the current commit and `main`
# NOTE: If a pull request changes the image, then we need to build the image and then build
# CLP using the changed image; otherwise we can build CLP using the published image. So when
# determining what files have changed, we use `main` rather than the previous commit to ensure
# that on every push to the PR, we can detect if the image was changed and use it to build
# and test CLP.
PATHS_FILTER_BASE: "main"
PATHS_FILTER_LIB_INSTALL_GLOB: "components/core/tools/scripts/lib_install/*.sh"
PATHS_FILTER_CLP_FILTER: |
clp:
- ".github/actions/**"
- ".github/workflows/clp-core-build.yaml"
- ".gitmodules"
- "components/core/cmake/**"
- "components/core/CMakeLists.txt"
- "components/core/src/**"
- "components/core/tests/**"
- "components/core/tools/scripts/deps-download/**"
- "components/core/tools/scripts/utils/build-and-run-unit-tests.sh"
# Currency group to prevent multiple workflow instances from trying to publish container images
concurrency: "${{github.workflow}}-${{github.ref}}"
jobs:
centos74:
runs-on: "ubuntu-latest"
services:
registry:
image: "registry:2"
ports: ["5000:5000"]
env:
OS_NAME: "centos7.4"
steps:
- uses: "actions/checkout@v3"
with:
submodules: "recursive"
- name: "Work around actions/runner-images/issues/6775"
run: "chown $(id -u):$(id -g) -R ."
shell: "bash"
- name: "Filter relevant changes"
uses: "dorny/paths-filter@v2"
id: "filter"
with:
base: "${{env.PATHS_FILTER_BASE}}"
filters: |
image:
- ".github/actions/**"
- ".github/workflows/clp-core-build.yaml"
- ${{env.PATHS_FILTER_LIB_INSTALL_GLOB}}
- "components/core/tools/docker-images/clp-env-base-${{env.OS_NAME}}/**"
- "components/core/tools/scripts/lib_install/${{env.OS_NAME}}/**"
${{inputs.PATHS_FILTER_CLP_FILTER}}
- uses: "./.github/actions/clp-core-build-deps-and-binaries"
with:
os_name: "${{env.OS_NAME}}"
deps_image_changed: "${{steps.filter.outputs.image}}"
push_binaries_image: false
local_registry_port: "5000"
token: "${{secrets.GITHUB_TOKEN}}"
ubuntu-focal:
runs-on: "ubuntu-latest"
services:
registry:
image: "registry:2"
ports: ["5000:5000"]
env:
OS_NAME: "ubuntu-focal"
steps:
- uses: "actions/checkout@v3"
with:
submodules: "recursive"
- name: "Work around actions/runner-images/issues/6775"
run: "chown $(id -u):$(id -g) -R ."
shell: "bash"
- name: "Filter relevant changes"
uses: "dorny/paths-filter@v2"
id: "filter"
with:
base: "${{env.PATHS_FILTER_BASE}}"
filters: |
image:
- ".github/actions/**"
- ".github/workflows/clp-core-build.yaml"
- ${{env.PATHS_FILTER_LIB_INSTALL_GLOB}}
- "components/core/tools/docker-images/clp-env-base-${{env.OS_NAME}}/**"
- "components/core/tools/scripts/lib_install/${{env.OS_NAME}}/**"
${{inputs.PATHS_FILTER_CLP_FILTER}}
- uses: "./.github/actions/clp-core-build-deps-and-binaries"
with:
os_name: "${{env.OS_NAME}}"
deps_image_changed: "${{steps.filter.outputs.image}}"
push_binaries_image: true
local_registry_port: "5000"
token: "${{secrets.GITHUB_TOKEN}}"
ubuntu-jammy:
runs-on: "ubuntu-latest"
services:
registry:
image: "registry:2"
ports: ["5000:5000"]
env:
OS_NAME: "ubuntu-jammy"
steps:
- uses: "actions/checkout@v3"
with:
submodules: "recursive"
- name: "Work around actions/runner-images/issues/6775"
run: "chown $(id -u):$(id -g) -R ."
shell: "bash"
- name: "Filter relevant changes"
uses: "dorny/paths-filter@v2"
id: "filter"
with:
base: "${{env.PATHS_FILTER_BASE}}"
filters: |
image:
- ".github/actions/**"
- ".github/workflows/clp-core-build.yaml"
- ${{env.PATHS_FILTER_LIB_INSTALL_GLOB}}
- "components/core/tools/docker-images/clp-env-base-${{env.OS_NAME}}/**"
- "components/core/tools/scripts/lib_install/${{env.OS_NAME}}/**"
${{inputs.PATHS_FILTER_CLP_FILTER}}
- uses: "./.github/actions/clp-core-build-deps-and-binaries"
with:
os_name: "${{env.OS_NAME}}"
deps_image_changed: "${{steps.filter.outputs.image}}"
push_binaries_image: false
local_registry_port: "5000"
token: "${{secrets.GITHUB_TOKEN}}"