Skip to content

Commit 087f409

Browse files
authored
CI: Don't rebuild Linux vcpkg image on thirdparty update (#4492)
1 parent e6a0a4e commit 087f409

File tree

3 files changed

+61
-5
lines changed

3 files changed

+61
-5
lines changed

.github/workflows/build-test-distribute.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
with:
4141
docker_image_tag: ${{ needs.config.outputs.docker_image_tag }}
4242
need_linux_image_rebuild: ${{ needs.config.outputs.need_linux_image_rebuild == 'true' }}
43+
need_linux_vcpkg_rebuild: ${{ needs.config.outputs.need_linux_vcpkg_rebuild == 'true' }}
4344
need_windows_vcpkg_rebuild: ${{ needs.config.outputs.need_windows_vcpkg_rebuild == 'true' }}
4445
vs19_vcpkg_version: ${{ needs.config.outputs.vs19_vcpkg_version }}
4546
vs22_vcpkg_version: ${{ needs.config.outputs.vs22_vcpkg_version }}

.github/workflows/config.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on:
2626
need_linux_image_rebuild:
2727
description:
2828
value: ${{ jobs.prepare-config.outputs.linux-changes == 'true' && github.event_name != 'schedule' && jobs.prepare-config.outputs.tag-skip-image-rebuild != 'true' }}
29+
need_linux_vcpkg_rebuild:
30+
description:
31+
value: ${{ jobs.prepare-config.outputs.linux-vcpkg-changes == 'true' && github.event_name != 'schedule' && jobs.prepare-config.outputs.tag-skip-image-rebuild != 'true' }}
2932
need_windows_vcpkg_rebuild:
3033
description:
3134
value: ${{ ( jobs.prepare-config.outputs.windows-changes == 'true' || jobs.prepare-config.outputs.tag-bump-vcpkg == 'true' ) && jobs.prepare-config.outputs.tag-skip-image-rebuild != 'true' }}
@@ -80,6 +83,7 @@ jobs:
8083
docker-image-tag: ${{ steps.select-docker-image-tag.outputs.image_tag }}
8184
release_tag: ${{ steps.version-tag.outputs.release_tag }}
8285
linux-changes: ${{ steps.linux-changes.outputs.src }}
86+
linux-vcpkg-changes: ${{ steps.linux-vcpkg-changes.outputs.src }}
8387
ubuntu_x64_config_matrix: ${{ steps.set-ubuntu-x64-matrix.outputs.matrix }}
8488
windows-changes: ${{ steps.windows-changes.outputs.src }}
8589
# please list the required tags here
@@ -119,14 +123,24 @@ jobs:
119123
with:
120124
filters: |
121125
src:
122-
- 'docker/*Dockerfile'
123-
- 'requirements/!(windows.txt|macos.txt|python.txt|Brewfile)'
126+
- 'docker/(ubuntu20|ubuntu22|ubuntu24|fedora39|emscripten)Dockerfile'
127+
- 'requirements/(ubuntu|fedora|distribution_python).txt'
124128
- 'scripts/build_thirdparty.sh'
125129
- 'scripts/install_apt_requirements.sh'
126130
- 'scripts/install_dnf_requirements.sh'
127131
- 'scripts/mrbind/install_deps_ubuntu.sh'
128132
- 'thirdparty/!(install.bat|vcpkg/**)'
129133
134+
- name: Filter Linux vcpkg paths
135+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
136+
id: linux-vcpkg-changes
137+
with:
138+
filters: |
139+
src:
140+
- 'docker/vcpkgDockerfile'
141+
- 'requirements/vcpkg-linux.txt'
142+
- 'thirdparty/vcpkg/**'
143+
130144
- name: Filter Windows paths
131145
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
132146
id: windows-changes

.github/workflows/prepare-images.yml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
need_linux_image_rebuild:
1010
required: true
1111
type: boolean
12+
need_linux_vcpkg_rebuild:
13+
required: true
14+
type: boolean
1215
need_windows_vcpkg_rebuild:
1316
required: true
1417
type: boolean
@@ -35,13 +38,11 @@ jobs:
3538
strategy:
3639
fail-fast: false
3740
matrix:
38-
distro: [ ubuntu20, ubuntu22, ubuntu24, fedora39, vcpkg, emscripten ]
41+
distro: [ ubuntu20, ubuntu22, ubuntu24, fedora39, emscripten ]
3942
arch: [ x64, arm64 ]
4043
exclude:
4144
- distro: fedora39
4245
arch: arm64
43-
- distro: vcpkg
44-
arch: arm64
4546
- distro: emscripten
4647
arch: x64
4748
include:
@@ -99,6 +100,46 @@ jobs:
99100
- name: Remove unused Docker data
100101
run: docker system prune --force --all --volumes
101102

103+
linux-vcpkg-build-upload:
104+
if: ${{ inputs.need_linux_vcpkg_rebuild }}
105+
timeout-minutes: 75
106+
strategy:
107+
fail-fast: false
108+
matrix:
109+
arch: [ x64 ]
110+
include:
111+
- arch: x64
112+
image-suffix: ''
113+
os: ubuntu-latest
114+
- arch: arm64
115+
image-suffix: '-arm64'
116+
os: [ self-hosted, linux-arm64, on-demand, meshinspector ]
117+
runs-on: ${{ matrix.os }}
118+
env:
119+
image: meshlib/meshlib-vcpkg${{ matrix.image-suffix }}:${{ inputs.docker_image_tag }}
120+
vcpkg_triplet: ${{ matrix.arch }}-linux-meshlib
121+
steps:
122+
- name: Remove unused Docker data
123+
run: docker system prune --force --all --volumes
124+
125+
- name: Checkout
126+
uses: actions/checkout@v4
127+
128+
- name: Login to DockerHub
129+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
130+
with:
131+
username: meshlib
132+
password: ${{ secrets.DOCKERHUB_TOKEN }}
133+
134+
- name: Build Linux vcpkg image
135+
run: docker build -f ./docker/vcpkgDockerfile -t ${{ env.image }} --build-arg VCPKG_TRIPLET=${{ env.vcpkg_triplet }} . --progress=plain
136+
137+
- name: Push Linux vcpkg image
138+
run: docker push ${{ env.image }}
139+
140+
- name: Remove unused Docker data
141+
run: docker system prune --force --all --volumes
142+
102143
windows-vcpkg-build-upload:
103144
if: ${{ inputs.need_windows_vcpkg_rebuild }}
104145
timeout-minutes: 240

0 commit comments

Comments
 (0)