Skip to content

Commit

Permalink
Update github actions and gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaraslaut committed Jul 24, 2024
1 parent 22936a4 commit ca11c48
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 174 deletions.
97 changes: 10 additions & 87 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,110 +30,33 @@ jobs:
strategy:
fail-fast: false
matrix:
compiler:
[
"GCC 10",
"Clang 10",
# (CI related error) "Clang 11",
"Clang 12"
]
name: "Ubuntu Linux 20.04 (${{ matrix.compiler }})"
runs-on: ubuntu-20.04
os_version: ['20.04', '22.04', '24.04']
name: "Ubuntu ${{ matrix.os_version }}"
runs-on: ubuntu-${{ matrix.os_version }}
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: "ccache-ubuntu_2004-${{ matrix.compiler }}"
key: "ccache-ubuntu_${{ matrix.os_version }}"
max-size: 256M
- name: "Update package database"
run: sudo apt -q update
- name: "install dependencies"
env:
COMPILER: "${{ matrix.compiler }}"
run: ./scripts/install-deps.sh
- name: "create build directory"
run: mkdir build
- name: "cmake"
env:
COMPILER: "${{ matrix.compiler }}"
run: |
BUILD_DIR="build" \
CMAKE_BUILD_TYPE="RelWithDebInfo" \
./scripts/ci-prepare.sh
cmake -S . -B build -G Ninja
-D CMAKE_BUILD_TYPE="RelWithDebInfo" \
-D LIBUNICODE_BENCHMARK=ON \
-D LIBUNICODE_TESTING=ON
- name: "build"
run: cmake --build build/ -- -j3
- name: "test"
run: ./build/src/libunicode/unicode_test


ubuntu_matrix_22:
strategy:
fail-fast: false
matrix:
compiler:
[
"GCC 10",
"GCC 13",
# (CI related error) "Clang 11",
"Clang 15"
]
# gcc 13 only in github runners and not inside official repo
name: "Ubuntu Linux 22.04 (${{ matrix.compiler }})"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: "ccache-ubuntu_2204-${{ matrix.compiler }}"
max-size: 256M
- name: "Update package database"
run: sudo apt -q update
- name: "install dependencies"
env:
COMPILER: "${{ matrix.compiler }}"
run: ./scripts/install-deps.sh
- name: "create build directory"
run: mkdir build
- name: "cmake"
env:
COMPILER: "${{ matrix.compiler }}"
run: |
BUILD_DIR="build" \
CMAKE_BUILD_TYPE="RelWithDebInfo" \
./scripts/ci-prepare.sh
- name: "build"
run: cmake --build build/ -- -j3
- name: "test"
run: ./build/src/libunicode/unicode_test
- name: "benchmark"
run: ./build/src/libunicode/libunicode_benchmark

unknown_os:
name: "Unknown OS"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: "ccache-ubuntu_2004-unknown-os"
max-size: 256M
- name: "Update package database"
run: sudo apt -q update
- name: "install dependencies"
run: |
set -ex
sudo apt install -q -y ninja-build gcc build-essential cmake debhelper dpkg-dev g++ libc6-dev
OS_OVERRIDE=UNKNOWN ./scripts/install-deps.sh
- name: "cmake"
run: cmake --preset linux-gcc-release
- name: "build"
run: cmake --build --preset linux-gcc-release -j3
- name: "test"
run: ctest --preset linux-gcc-release

windows:
name: "Windows"
runs-on: windows-latest
Expand All @@ -156,8 +79,8 @@ jobs:

Fedora:
name: Fedora
runs-on: ubuntu-22.04
container: fedora:rawhide
runs-on: ubuntu-24.04
container: fedora:latest

steps:
- uses: actions/checkout@v4
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
name: "Check C++ style"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
clang-format-version: '14'
check-path: 'src'



- uses: actions/checkout@v4
- name: Install clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt-get install clang-format-18
- name: "Clang-format"
run: find ./src/ -name "*.cpp" -o -name "*.h" | xargs clang-format-18 --Werror --dry-run
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ src/libunicode/ucd.h
src/libunicode/ucd_enums.h
src/libunicode/ucd_fmt.h
src/libunicode/ucd_ostream.h
/src/libunicode/codepoint_properties_data.cpp
/src/libunicode/codepoint_properties_data.h
/src/libunicode/codepoint_properties_names.cpp
62 changes: 0 additions & 62 deletions scripts/ci-prepare.sh

This file was deleted.

17 changes: 1 addition & 16 deletions scripts/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,28 +108,13 @@ install_deps_ubuntu()
g++
libc6-dev
make
ninja-build
"

if [ ! "$COMPILER" = "" ]; then
local PKGVER=`echo $COMPILER | awk '{print $2}'`
local PKGNAME=`echo $COMPILER | awk '{print tolower($1);}'`
test "$PKGNAME" = "gcc" && PKGNAME="g++"
packages="$packages $PKGNAME-$PKGVER"
fi

RELEASE=`grep VERSION_ID /etc/os-release | cut -d= -f2 | tr -d '"'`

local NAME=`grep ^NAME /etc/os-release | cut -d= -f2 | cut -f1 | tr -d '"'`

if [ ! "${NAME}" = "Debian GNU/Linux" ]; then
# We cannot use [[ nor < here because that's not in /bin/sh.
if [ "$RELEASE" = "18.04" ]; then
# Old Ubuntu's (especially 18.04 LTS) doesn't have a proper std::filesystem implementation.
#packages+=libboost-all-dev
packages="$packages g++-8"
fi
fi

case $RELEASE in
"20.04" | "22.04")
fetch_and_unpack_fmtlib
Expand Down

0 comments on commit ca11c48

Please sign in to comment.