Skip to content

Commit

Permalink
Fix github CI
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Shumilov <p.shumilov@vkteam.ru>
  • Loading branch information
PetrShumilov committed Jan 30, 2025
1 parent 352d93d commit 914767a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 21 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ jobs:
name: "${{matrix.os}}/${{matrix.compiler}}/c++${{matrix.cpp}}/asan=${{matrix.asan}}/ubsan=${{matrix.ubsan}}"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get polyfills repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 'VKCOM/kphp-polyfills'
path: 'kphp-polyfills'

- name: Cache docker image
uses: actions/cache@v3
uses: actions/cache@v4
id: docker-image-cache
with:
path: kphp-build-env-${{matrix.os}}.tar
Expand All @@ -77,11 +77,16 @@ jobs:
- name: Add git safe directory
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"git config --global --add safe.directory ${{env.kphp_root_dir}}"
"git config --global --add safe.directory '*'"
# This command is used to address potential issues with Git's safe directory feature.
# This is particularly relevant in CI environments where the repository
# might be checked out by a different user than the one executing the workflow steps.
# By setting '*' as a safe directory, we allow Git operations to proceed without errors
# related to directory safety, ensuring smooth execution of the workflow.

- name: Build all
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"cmake -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_CXX_STANDARD=${{matrix.cpp}} -DADDRESS_SANITIZER=${{matrix.asan}} -DUNDEFINED_SANITIZER=${{matrix.ubsan}} -DPDO_DRIVER_MYSQL=ON -DPDO_DRIVER_PGSQL=ON -DPDO_LIBS_STATIC_LINKING=ON -S ${{env.kphp_root_dir}} -B ${{env.kphp_build_dir}} && make -C ${{env.kphp_build_dir}} -j$(nproc) all"
"cmake -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_CXX_STANDARD=${{matrix.cpp}} -DADDRESS_SANITIZER=${{matrix.asan}} -DUNDEFINED_SANITIZER=${{matrix.ubsan}} -DPDO_DRIVER_MYSQL=ON -DPDO_DRIVER_PGSQL=ON -DPDO_LIBS_STATIC_LINKING=OFF -S ${{env.kphp_root_dir}} -B ${{env.kphp_build_dir}} && make -C ${{env.kphp_build_dir}} -j$(nproc) all"

- name: Run unit tests
run: docker exec kphp-build-container-${{matrix.os}} bash -c
Expand All @@ -107,7 +112,7 @@ jobs:
rm -rf ${{runner.temp}}/_tmp/*/working_dir

- name: Upload python tests artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: steps.python_tests.outcome == 'failure'
with:
path: ${{runner.temp}}/_tmp/
Expand All @@ -131,7 +136,7 @@ jobs:
name: "${{matrix.os}}/${{matrix.compiler}}/c++${{matrix.cpp}}"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# because of https://github.com/orgs/Homebrew/discussions/4612
- name: Check Environment
Expand All @@ -143,7 +148,7 @@ jobs:
run: |
brew tap shivammathur/php
brew update
brew install python@3.13 re2c cmake coreutils openssl libiconv re2 pcre yaml-cpp zstd googletest shivammathur/php/php@7.4
brew install python@3.13 re2c cmake coreutils libiconv re2 pcre yaml-cpp zstd googletest shivammathur/php/php@7.4
brew link --overwrite --force shivammathur/php/php@7.4
/opt/homebrew/opt/python@3.13/libexec/bin/python -m pip install --upgrade pip --break-system-packages && /opt/homebrew/opt/python@3.13/libexec/bin/pip install --break-system-packages jsonschema
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/Dockerfile.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ RUN apt update && \
add-apt-repository ppa:deadsnakes/ppa && \
apt update && \
apt install -y --no-install-recommends \
git cmake make g++ lld gperf netcat \
python3.7 python3-pip python3.7-distutils python3.7-dev libpython3.7-dev python3-jsonschema python3-setuptools mysql-server libmysqlclient-dev && \
python3.7 -m pip install pip && python3.7 -m pip install -r /tmp/requirements.txt && \
build-essential devscripts fakeroot git cmake make g++ lld gperf netcat \
python3.7 python3-pip python3.7-distutils python3.7-dev libpython3.7-dev python3-jsonschema python3-setuptools && \
apt install -y --no-install-recommends kphp-timelib libuber-h3-dev libfmt-dev libgtest-dev libgmock-dev libre2-dev libpcre3-dev \
libzstd-dev libyaml-cpp-dev libnghttp2-dev zlib1g-dev php7.4-dev libnuma-dev unzip \
libldap-dev libkrb5-dev libpq5=14.* postgresql-14 postgresql-server-dev-14 libpq-dev=14.* && \
libzstd-dev libyaml-cpp-dev libnghttp2-dev zlib1g-dev php7.4-dev libnuma-dev unzip && \
# Install MySQL-related and PostgreSQL-related libraries from the Ubuntu 20.04 (Focal Fossa) repository.
# Ubuntu 22.04 has moved to OpenSSL 3.0; however, KPHP relies on OpenSSL 1.1.1.
# Therefore, we use downgraded libraries that are compatible with OpenSSL 1.1.1.
echo "deb https://archive.ubuntu.com/ubuntu focal main universe" >> /etc/apt/sources.list && \
apt update && \
apt install -t focal -y --no-install-recommends --allow-downgrades mysql-server libmysqlclient-dev \
libldap-dev libtinfo6=6.2* ncurses-bin=6.2* libncurses6=6.2* libncursesw6=6.2* libncurses-dev=6.2* libtinfo-dev=6.2* libcom-err2=1.45* comerr-dev=2.1-1.45* libkrb5support0=1.17* libkrb5-3=1.17* libk5crypto3=1.17* libgssapi-krb5-2=1.17* libkrb5-dev=1.17* libpq5=12.* ssl-cert=1.1.* postgresql-common locales=2.35* postgresql-12 libpq-dev=12.* && \
python3.7 -m pip install pip && python3.7 -m pip install -r /tmp/requirements.txt && \
rm -rf /var/lib/apt/lists/*

# set php7.4 as default
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ jobs:
name: "${{matrix.os}}/${{matrix.compiler}}/c++${{matrix.cpp}}/asan=${{matrix.asan}}/ubsan=${{matrix.ubsan}}"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get polyfills repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 'VKCOM/kphp-polyfills'
path: 'kphp-polyfills'

- name: Cache docker image
uses: actions/cache@v3
uses: actions/cache@v4
id: docker-image-cache
with:
path: kphp-build-env-${{matrix.os}}.tar
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: "${{matrix.os}}/${{matrix.compiler}}/c++${{matrix.cpp}}"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# because of https://github.com/orgs/Homebrew/discussions/4612
- name: Check Environment
Expand All @@ -33,7 +33,7 @@ jobs:
run: |
brew tap shivammathur/php
brew update
brew install python@3.13 re2c cmake coreutils openssl libiconv re2 pcre yaml-cpp zstd googletest shivammathur/php/php@7.4
brew install python@3.13 re2c cmake coreutils libiconv re2 pcre yaml-cpp zstd googletest shivammathur/php/php@7.4
brew link --overwrite --force shivammathur/php/php@7.4
/opt/homebrew/opt/python@3.13/libexec/bin/python -m pip install --upgrade pip --break-system-packages && /opt/homebrew/opt/python@3.13/libexec/bin/pip install --break-system-packages jsonschema
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ jobs:
name: "${{matrix.os}}/${{matrix.compiler}}/c++${{matrix.cpp}}/asan=${{matrix.asan}}/ubsan=${{matrix.ubsan}}"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get polyfills repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 'VKCOM/kphp-polyfills'
path: 'kphp-polyfills'

- name: Cache docker image
uses: actions/cache@v3
uses: actions/cache@v4
id: docker-image-cache
with:
path: kphp-build-env-${{matrix.os}}.tar
Expand Down

0 comments on commit 914767a

Please sign in to comment.