Skip to content

Commit

Permalink
ci: Migrate to alpine base image
Browse files Browse the repository at this point in the history
  • Loading branch information
taminob committed Mar 15, 2024
1 parent d17199d commit b8868d5
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 44 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/cmake-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ on:
jobs:
lint:
name: "cmake lint"
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: jirutka/setup-alpine@v1
with:
branch: v3.19
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get -y --no-install-recommends install \
sudo apt update -y
sudo apt -y --no-install-recommends install \
python3-pip='22.*'
pip install cmakelint
shell: alpine.sh {0}
- name: Execute cmakelint
run: find . \( \( -path './build' -o -path '*/.*' \) -prune \) -o
\( -type f -a -iname 'CMakeLists.txt' \)
-exec echo "Linting '{}'..." \;
-exec cmakelint --spaces=1 {} +
shell: alpine.sh {0}
30 changes: 18 additions & 12 deletions .github/workflows/cpp-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,29 @@ on:
jobs:
build:
name: "gcc/clang build"
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
cpp17_compatibility: [ "ON", "OFF" ]
cpp_compiler: [ "g++", "clang++" ]
steps:
- uses: actions/checkout@v3
- uses: jirutka/setup-alpine@v1
with:
branch: v3.19
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get -y --no-install-recommends install \
cmake='3.22.*' \
gcc-11='11.*' \
clang='1:14.*' \
libboost-filesystem-dev='1.74.*' \
libboost-python-dev='1.74.*' \
liblua5.4-dev='5.*' \
libfmt-dev='8.*' \
libgmock-dev='1.11.*' \
libgtest-dev='1.11.*'
sudo apk update
sudo apk add \
cmake \
gcc \
clang \
boost-filesystem \
boost-python3 \
lua-dev \
fmt \
gmock \
gtest
- name: Execute cmake
run: |
CXX=/usr/bin/${{ matrix.cpp_compiler }} \
Expand All @@ -37,11 +40,14 @@ jobs:
-DPPPLUGIN_ENABLE_EXAMPLES=ON \
-DPPPLUGIN_ENABLE_TESTS=ON \
-DPPPLUGIN_ENABLE_CPP17_COMPATIBILITY=${{ matrix.cpp17_compatibility }}
shell: alpine.sh {0}
- name: Execute make
run: |
cd build
make -j
shell: alpine.sh {0}
- name: Install
run: |
cd build
make install
shell: alpine.sh {0}
29 changes: 17 additions & 12 deletions .github/workflows/cpp-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,36 @@ on:
jobs:
lint:
name: "clang-tidy"
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: jirutka/setup-alpine@v1
with:
branch: v3.19
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get -y --no-install-recommends install \
cmake='3.22.*' \
gcc-11='11.*' \
clang-tidy='1:14.*' \
libboost-filesystem-dev='1.74.*' \
libboost-python-dev='1.74.*' \
liblua5.4-dev='5.*' \
libfmt-dev='8.*' \
libgmock-dev='1.11.*' \
libgtest-dev='1.11.*'
sudo apk update
sudo apk add \
cmake \
clang-extra-tools \
boost-filesystem \
boost-python3 \
lua-dev \
fmt \
gmock \
gtest
shell: alpine.sh {0}
- name: Generate compile_commands.json
run: |
mkdir -pv build
cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
shell: alpine.sh {0}
# Check all source and header C++ files;
# ignore files in the build directory or in hidden directories
- name: Execute clang-tidy
run: find . \( \( -path './build' -o -path '*/.*' \) -prune \) -o
\( -type f -a \( -iname '*.cpp' -o -iname '*.h' \) \)
-exec echo "Linting '{}'..." \;
-exec clang-tidy -p build --warnings-as-errors='*' {} +
shell: alpine.sh {0}
31 changes: 19 additions & 12 deletions .github/workflows/cpp-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,29 @@ on:
jobs:
unittest:
name: "unittests"
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
cpp17_compatibility: [ "ON", "OFF" ]
steps:
- uses: actions/checkout@v3
- uses: jirutka/setup-alpine@v1
with:
branch: v3.19
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get -y --no-install-recommends install \
cmake='3.22.*' \
gcc-11='11.*' \
clang='1:14.*' \
libboost-filesystem-dev='1.74.*' \
libboost-python-dev='1.74.*' \
liblua5.4-dev='5.*' \
libfmt-dev='8.*' \
libgmock-dev='1.11.*' \
libgtest-dev='1.11.*'
sudo apk update
sudo apk add \
cmake \
gcc \
boost-filesystem \
boost-python3 \
lua-dev \
fmt \
gmock \
gtest \
lcov
shell: alpine.sh {0}
- name: Execute cmake
run: |
CXX=/usr/bin/${{ matrix.cpp_compiler }} \
Expand All @@ -35,10 +39,12 @@ jobs:
-DPPPLUGIN_ENABLE_TESTS=ON \
-DPPPLUGIN_ENABLE_COVERAGE=ON \
-DPPPLUGIN_ENABLE_CPP17_COMPATIBILITY=${{ matrix.cpp17_compatibility }}
shell: alpine.sh {0}
- name: Execute make
run: |
cd build
make -j
shell: alpine.sh {0}
- name: Execute tests
run: |
cd build
Expand All @@ -50,3 +56,4 @@ jobs:
lcov -r coverage_without_system_files "*/test/*" -o coverage_without_system_and_test_files
genhtml --output-directory coverage --legend coverage_without_system_and_test_files
lcov --list coverage_without_system_and_test_files
shell: alpine.sh {0}
17 changes: 12 additions & 5 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,31 @@ on:
jobs:
format:
name: "clang-format/cmake-format"
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: jirutka/setup-alpine@v1
with:
branch: v3.19
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get -y --no-install-recommends install \
clang-format='1:14.*' \
cmake-format='0.6.*'
sudo apk update
sudo apk add \
clang-extra-tools \
py3-pip
pip install --break-system-packages cmake-format
shell: alpine.sh {0}
# Check all source and header C++ files; ignore files in hidden directories
- name: Execute clang-format
run: find . \( -path '*/.*' -prune \) -o
\( -type f -a \( -iname '*.cpp' -o -iname '*.h' \) \)
-exec echo "Format checking '{}'..." \;
-exec clang-format --dry-run --Werror --Wno-error=unknown {} +
shell: alpine.sh {0}
# Check all cmake files; ignore files in hidden directories
- name: Execute cmake-format
run: find . \( -path '*/.*' -prune \) -o
\( -type f -a -name 'CMakeLists.txt' \)
-exec echo "Format checking '{}'..." \;
-exec cmake-format --check -- {} +
shell: alpine.sh {0}

0 comments on commit b8868d5

Please sign in to comment.