Skip to content

Commit

Permalink
ci: change gcc7 build test
Browse files Browse the repository at this point in the history
- remove deprecated ubuntu-20.04 image;
- use docker image for build
  • Loading branch information
ctapmex committed Feb 23, 2025
1 parent 5550501 commit f2ee961
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 40 deletions.
51 changes: 11 additions & 40 deletions .github/workflows/colorer_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,52 +33,23 @@ env:
jobs:

ubuntu-old-gcc:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
arch: [ x64 ]
icu: [OFF]
zip: [OFF]

name: linux-gcc7-${{ matrix.arch }}-icu_${{ matrix.icu }}-zip_${{ matrix.zip }}
runs-on: ubuntu-latest
name: linux-gcc7-x64-icu_OFF-zip_OFF

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Install dependency
run: sudo apt-get -y install ninja-build libicu-dev zlib1g-dev libminizip-dev libxml2-dev

- name: Install compiler
run: sudo apt-get -y install g++-7

- name: Create Build folder
run: mkdir -p _build

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: Configure CMake
run: >
cmake -S . -B _build -G "Ninja"
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DCOLORER_BUILD_TEST=ON
-DCOLORER_USE_VCPKG=OFF
-DCOLORER_BUILD_ARCH=${{ matrix.arch }}
-DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }}
-DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }}
-DCOLORER_BUILD_OLD_COMPILERS=ON
-DCOLORER_BUILD_HARD_WARNINGS=OFF
-DCMAKE_CXX_COMPILER=/usr/bin/g++-7
- name: Build
run: cmake --build _build --config $BUILD_TYPE -j ${{ steps.cpu-cores.outputs.count }}
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.PACKAGES_GITHUB_USER }}
password: ${{ secrets.PACKAGES_GITHUB_TOKEN }}

- name: Test
working-directory: ./tests/unit
run: ../../_build/tests/unit/unit_tests
- name: 'Build in docker'
run: |
docker build -f ci/Dockerfile.gcc7-test -t tempx:latest .
ubuntu-gcc:
runs-on: ubuntu-22.04
Expand Down
18 changes: 18 additions & 0 deletions ci/Dockerfile.gcc7-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Image for the test build Colorer with gcc/g++ 7.5
# run build from root of project

FROM ghcr.io/colorer/devimage-colorer:gcc7

SHELL ["/bin/bash", "-xeuo", "pipefail", "-c"]

WORKDIR /code

RUN --mount=type=bind,source=.,target=/code/colorer \
<<EOT
mkdir build
cmake -S colorer -B build -DCMAKE_BUILD_TYPE=Release -DCOLORER_BUILD_TEST=ON -DCOLORER_USE_VCPKG=OFF \
-DCOLORER_BUILD_ARCH=x64 -DCOLORER_USE_ICU_STRINGS=OFF -DCOLORER_USE_ZIPINPUTSOURCE=OFF \
-DCOLORER_BUILD_OLD_COMPILERS=ON -DCOLORER_BUILD_HARD_WARNINGS=OFF
cmake --build build
./build/tests/unit/unit_tests
EOT

0 comments on commit f2ee961

Please sign in to comment.