Skip to content

Commit

Permalink
internal: check Linux build on commonly used distros
Browse files Browse the repository at this point in the history
  • Loading branch information
nic11 committed Dec 22, 2024
1 parent e75cfd1 commit c3b319b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/pr-ubuntu-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ env:

jobs:
pr-ubuntu-docker:
strategy:
matrix:
base_system:
# The usual container used for all builds within the CI and the one
# we use as the base for server builds with preinstalled/cached deps
- vcpkg-deps

# Distros that our contributors are likely to run
# - ubuntu-2204
# - ubuntu-2404
# - debian
# - archlinux
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -20,7 +32,17 @@ jobs:

- name: Get image to build upon
run: |
set -x # print executed commands
cat ${{github.workspace}}/misc/github_env_linux >> "$GITHUB_ENV"
# get latest image
base_image="`misc/deps_linux/${{ matrix.base_system }}.sh --get-image-uri`"
docker run -it \
--name prepare_deps_container \
-v "${{github.workspace}}:/src" \
"$base_image" \
bash -c bash \
'misc/deps_linux/${{ matrix.base_system }}.sh --ensure-deps-noninteractive'
docker commit prepare_deps_container localhost/buildimage
- name: Store SP types from commit
run: |
Expand Down Expand Up @@ -58,7 +80,7 @@ jobs:
- name: Prepare
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
image: localhost/buildimage
options: |
-v ${{github.workspace}}:/src
run: |
Expand All @@ -68,7 +90,7 @@ jobs:
id: cmake_configure
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
image: localhost/buildimage
options: |
-v ${{github.workspace}}:/src
-u skymp
Expand All @@ -94,7 +116,7 @@ jobs:
- name: Build
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
image: localhost/buildimage
options: |
-v ${{github.workspace}}:/src
-u skymp
Expand All @@ -105,7 +127,7 @@ jobs:
- name: Prepare dist.tar.gz
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
image: localhost/buildimage
options: |
-v ${{github.workspace}}:/src
-u skymp
Expand Down Expand Up @@ -164,7 +186,7 @@ jobs:
- name: Test
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
image: localhost/buildimage
options: |
-v ${{github.workspace}}:/src
-u skymp
Expand Down
3 changes: 3 additions & 0 deletions misc/deps_linux/ubuntu-2204.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"image": "ubuntu:22.04"
}
3 changes: 3 additions & 0 deletions misc/deps_linux/ubuntu-2404.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"image": "ubuntu:24.04"
}
8 changes: 8 additions & 0 deletions misc/deps_linux/vcpkg-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

if [[ "$1" == "--get-image-uri" ]]; then
. misc/github_env_linux && echo "$SKYMP_VCPKG_DEPS_IMAGE"
exit
elif [[ "$1" == "--ensure-deps-noninteractive" ]]; then
# Nothing to prepare, vcpkg-deps image already contains all we need
fi

0 comments on commit c3b319b

Please sign in to comment.