Skip to content

Commit

Permalink
Revert "WIP: do not use - slim CI"
Browse files Browse the repository at this point in the history
This reverts commit 77c650b.
  • Loading branch information
striezel committed Mar 25, 2024
1 parent 23a9cf9 commit 5aecf26
Show file tree
Hide file tree
Showing 6 changed files with 296 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Clang

on: push

jobs:
clang:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
version: [ 12, 13, 14 ]
steps:
# Checks-out the repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v4
- name: Install Debian packages
run: |
sudo apt-get update
sudo apt-get install -y catch2 clang-${{ matrix.version }} cmake git libcurl4-gnutls-dev libmariadb-dev pkg-config
- name: Start MySQL database
run: sudo systemctl start mysql.service
- name: Show MySQL version information
run: |
mysql -uroot -proot -e "SHOW VARIABLES LIKE '%version%';"
- name: Prepare MySQL database
run: |
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS weather_information_collector"
mysql -uroot -proot -e "GRANT ALL ON weather_information_collector.* TO 'root'@'localhost';"
mysql -uroot --password=root -e "SHOW DATABASES;"
- name: Adjust MySQL 8.0 authentication
run: |
mysql -uroot -proot -e "ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY ''; ALTER USER root@localhost IDENTIFIED BY 'root'; FLUSH PRIVILEGES;"
mysql -uroot --password=root -e "SHOW DATABASES;"
- name: Build
run: |
export CXX=clang++-${{ matrix.version }}
export CC=clang-${{ matrix.version }}
cd "$GITHUB_WORKSPACE"
mkdir build
cd build
cmake ../ -DJSON_BENCHMARK=ON
make -j2
- name: Tests
run: |
cd "$GITHUB_WORKSPACE"/build
ctest -V
48 changes: 48 additions & 0 deletions .github/workflows/debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Debian package

on:
push:
tags:
- v*

jobs:
package:
runs-on: ubuntu-20.04
steps:
# Checks-out the repository under $GITHUB_WORKSPACE.
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Debian packages
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential bzip2 ca-certificates debhelper devscripts fakeroot g++ git lsb-release tar wget
sudo apt-get install -y --no-install-recommends catch cmake g++ libcurl4-gnutls-dev libmariadb-dev
- name: Start MySQL database
run: sudo systemctl start mysql.service
- name: Show MySQL version information
run: |
mysql -uroot -proot -e "SHOW VARIABLES LIKE '%version%';"
- name: Prepare MySQL database
run: |
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS weather_information_collector"
mysql -uroot -proot -e "GRANT ALL ON weather_information_collector.* TO 'root'@'localhost';"
mysql -uroot --password=root -e "SHOW DATABASES;"
- name: Adjust MySQL 8.0 authentication
run: |
mysql -uroot -proot -e "ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY ''; ALTER USER root@localhost IDENTIFIED BY 'root'; FLUSH PRIVILEGES;"
mysql -uroot --password=root -e "SHOW DATABASES;"
- name: Build package
run: |
export CXX=g++
export CC=gcc
cd "$GITHUB_WORKSPACE"
./ci/gitlab-02-create-package.sh
pwd
ls -lah
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: package-debian
path: weather-information-collector*.deb
32 changes: 32 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Docker images

on: push

jobs:
# build_from_download:
# runs-on: ubuntu-22.04
# steps:
# # Checks-out the repository under $GITHUB_WORKSPACE.
# - uses: actions/checkout@v4
# - name: Build Dockerfile_download
# run: |
# cd docker
# docker build . -f Dockerfile_download
# build_single_stage:
# runs-on: ubuntu-22.04
# steps:
# # Checks-out the repository under $GITHUB_WORKSPACE.
# - uses: actions/checkout@v4
# - name: Build Dockerfile_build
# run: |
# cd docker
# docker build . -f Dockerfile_build
build_multiple_stages:
runs-on: ubuntu-22.04
steps:
# Checks-out the repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v4
- name: Build Dockerfile_multistage_build
run: |
cd docker
docker build . -f Dockerfile_multistage_build
61 changes: 61 additions & 0 deletions .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: GCC

on: push

jobs:
gcc:
strategy:
fail-fast: false
matrix:
include:
# GCC 8 is only available on Ubuntu 20.04, not on Ubuntu 22.04.
- version: 8
os: ubuntu-20.04
- version: 10
os: ubuntu-22.04
- version: 11
os: ubuntu-22.04
- version: 12
os: ubuntu-22.04
runs-on: ${{ matrix.os }}
steps:
# Checks-out the repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v4
- name: Install Debian packages (including Catch v1)
# Ubuntu 20.04 witch GCC 8 has no Catch v2, so we have to use v1 here.
if: matrix.version == 8
run: |
sudo apt-get update
sudo apt-get install -y catch cmake g++-${{ matrix.version }} git libcurl4-gnutls-dev libmariadb-dev pkg-config
- name: Install Debian packages (including Catch v2)
run: |
sudo apt-get update
sudo apt-get install -y catch2 cmake g++-${{ matrix.version }} git libcurl4-gnutls-dev libmariadb-dev pkg-config
if: matrix.version > 8
- name: Start MySQL database
run: sudo systemctl start mysql.service
- name: Show MySQL version information
run: |
mysql -uroot -proot -e "SHOW VARIABLES LIKE '%version%';"
- name: Prepare MySQL database
run: |
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS weather_information_collector"
mysql -uroot -proot -e "GRANT ALL ON weather_information_collector.* TO 'root'@'localhost';"
mysql -uroot --password=root -e "SHOW DATABASES;"
- name: Adjust MySQL 8.0 authentication
run: |
mysql -uroot -proot -e "ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY ''; ALTER USER root@localhost IDENTIFIED BY 'root'; FLUSH PRIVILEGES;"
mysql -uroot --password=root -e "SHOW DATABASES;"
- name: Build
run: |
export CXX=g++-${{ matrix.version }}
export CC=gcc-${{ matrix.version }}
cd "$GITHUB_WORKSPACE"
mkdir build
cd build
cmake ../ -DJSON_BENCHMARK=ON
make -j2
- name: Tests
run: |
cd "$GITHUB_WORKSPACE"/build
ctest -V
59 changes: 59 additions & 0 deletions .github/workflows/msys2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: MSYS2

on: push

jobs:
msys2_mingw64:
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
steps:
# Checks-out the repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: >-
git
mingw-w64-x86_64-catch
mingw-w64-x86_64-curl-winssl
mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-libmariadbclient
mingw-w64-x86_64-make
mingw-w64-x86_64-ninja
mingw-w64-x86_64-pkg-config
- name: Build
run: |
export MSYSTEM=MINGW64
export CXX=g++
export CC=gcc
cd "$GITHUB_WORKSPACE"
mkdir build
cd build
cmake ../ -DJSON_BENCHMARK=ON
cmake --build . -j2
- name: Tests
run: |
export MSYSTEM=MINGW64
cd "$GITHUB_WORKSPACE"/build
ctest -V
- name: Gather build artifacts
run: |
export MSYSTEM=MINGW64
cd "$GITHUB_WORKSPACE"
mkdir artifacts
./ci/copy-dll-dependencies.sh build/src/collector/weather-information-collector.exe artifacts/
./ci/copy-dll-dependencies.sh build/src/configtest/weather-information-collector-configtest.exe artifacts/
./ci/copy-dll-dependencies.sh build/src/creator/weather-information-collector-task-creator.exe artifacts/
./ci/copy-dll-dependencies.sh build/src/synchronizer/weather-information-collector-synchronizer.exe artifacts/
./ci/copy-dll-dependencies.sh build/src/update/weather-information-collector-update.exe artifacts/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: weather-information-collector-windows-msys2
path: |
artifacts/*
if-no-files-found: error
51 changes: 51 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test update program

on: push

jobs:
update_structure_v0_5_3:
runs-on: ubuntu-22.04
steps:
# Checks-out the repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v4
- name: Install Debian packages
run: |
sudo apt-get update
sudo apt-get install -y catch2 cmake g++-12 git libcurl4-gnutls-dev libmariadb-dev pkg-config
- name: Start MySQL database
run: sudo systemctl start mysql.service
- name: Show MySQL version information
run: |
mysql -uroot -proot -e "SHOW VARIABLES LIKE '%version%';"
- name: Prepare MySQL database
run: |
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS weather_information_collector"
mysql -uroot -proot -e "GRANT ALL ON weather_information_collector.* TO 'root'@'localhost';"
mysql -uroot --password=root -e "SHOW DATABASES;"
- name: Adjust MySQL 8.0 authentication
run: |
mysql -uroot -proot -e "ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY ''; ALTER USER root@localhost IDENTIFIED BY 'root'; FLUSH PRIVILEGES;"
mysql -uroot --password=root -e "SHOW DATABASES;"
- name: Build weather-information-collector-update
run: |
export CXX=g++-12
export CC=gcc-12
cd "$GITHUB_WORKSPACE"
mkdir build
cd build
cmake ../ -DJSON_BENCHMARK=OFF
make -j2 weather-information-collector-update
- name: Prepare table structure and connection information
run: |
sudo apt-get install -y mysql-client
cd "$GITHUB_WORKSPACE"
mysql -proot -u root -hlocalhost < ci/structure_v0.5.3.sql
touch connection.conf
echo "database.host=localhost" >> connection.conf
echo "database.name=weather_information_collector" >> connection.conf
echo "database.user=root" >> connection.conf
echo "database.password=root" >> connection.conf
- name: Tests
run: |
cd "$GITHUB_WORKSPACE"
./build/src/update/weather-information-collector-update -c connection.conf

0 comments on commit 5aecf26

Please sign in to comment.