Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] unit testing in FreeBSD and OpenBSD systems #3599

Merged
merged 57 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
ec9132b
added FreeBSD instance for unit testing
alex-w Jan 18, 2024
f9c763b
disable ShowMySky in FreeBSD
alex-w Jan 18, 2024
178867b
added other BSD systems
alex-w Jan 18, 2024
7d9d823
update some properties
alex-w Jan 18, 2024
1b54c55
another attempt to build the source code
alex-w Jan 18, 2024
3ca6cf3
fix properties
alex-w Jan 18, 2024
b33e743
a few fixes
alex-w Jan 18, 2024
baaf263
BSD-specific fixes
alex-w Jan 18, 2024
b23e2dd
update properties
alex-w Jan 18, 2024
c907c12
remove NetBSD and DragonflyBSD (too old distros) and add Solaris
alex-w Jan 18, 2024
960dfa0
oops... switch from ancient Solaris to OmniOS
alex-w Jan 18, 2024
6e799c6
remove OmniOS
alex-w Jan 18, 2024
cc0b002
typofix
alex-w Jan 18, 2024
0f7bcd2
let's try FreeBSD/Qt6
alex-w Jan 18, 2024
a7f91b1
disable ShowMySky for FreeBSD/Qt6 environment
alex-w Jan 18, 2024
adb49ec
add OpenBSD/Qt5 without ShowMySky
alex-w Jan 18, 2024
f35f342
a possible fix for OpenBSD CI
alex-w Jan 18, 2024
7d654a3
remove OpenBSD/qt5
alex-w Jan 18, 2024
6834ce0
fixed unit tests and added missing feature
alex-w Jan 18, 2024
b021fe9
disable assert
alex-w Jan 18, 2024
5f2d8cb
Let's enable ShowMySky in FreeBSD/Qt6
alex-w Jan 19, 2024
c4a4b67
Let's add eigen3 glm as packages for FreeBSD/Qt6
alex-w Jan 19, 2024
1f8e14b
oops... fix a typo
alex-w Jan 19, 2024
f711aed
switch to ShowMySky@master
alex-w Jan 19, 2024
50e32e6
Aargh... let's use ZIP-archive
alex-w Jan 19, 2024
db0a635
Update properties for CI
alex-w Jan 20, 2024
db2d4fe
Update ci-unix.yml
alex-w Jan 20, 2024
f814c94
Update ci-unix.yml
alex-w Jan 20, 2024
7bb5b7e
Update ci-unix.yml
alex-w Jan 20, 2024
17aa756
Add qtscript package in OpenBSD
alex-w Jan 20, 2024
109d37d
Update ci-unix.yml
alex-w Jan 20, 2024
5a6fd63
Update ci-unix.yml
alex-w Jan 20, 2024
68249a7
Update ci-unix.yml
alex-w Jan 20, 2024
cef55a9
Update ci-unix.yml
alex-w Jan 20, 2024
0fa7cca
Let's try re-adding NetBSD
alex-w Jan 20, 2024
884ac0c
NetBSD: fix path
alex-w Jan 20, 2024
f2d3e93
NetBSD: download and install pkgsrc
alex-w Jan 20, 2024
bd9f395
NetBSD: switch to use pkgin for MesaLib
alex-w Jan 20, 2024
67bccba
NetBSD: damn... obvious fix for pkgin
alex-w Jan 20, 2024
bf4018b
NetBSD: let't try to fix the path for pkgin
alex-w Jan 20, 2024
4df20c1
NetBSD: another attemnt to fix the path
alex-w Jan 20, 2024
2be08b8
NetBSD: final attempt
alex-w Jan 20, 2024
091eb74
NetBSD: hmm... let's use system path
alex-w Jan 20, 2024
c31b8dc
NetBSD: no OpenGL - no NetBSD CI instance
alex-w Jan 20, 2024
e9bb31c
DragonflyBSD: re-adding
alex-w Jan 20, 2024
489354c
DragonflyBSD: disable Lens Distortion Estimator plugin
alex-w Jan 20, 2024
d1aa810
DragonflyBSD: glm is too old - disable it
alex-w Jan 20, 2024
633d172
DragonflyBSD: disabling ShowMySky - troubles in dependencies
alex-w Jan 20, 2024
fc661f9
a small refactoring: reduce calls
alex-w Jan 20, 2024
1ffebc7
Solaris: attempt to re-adding
alex-w Jan 20, 2024
bf3fad4
Solaris: switch to use pkg
alex-w Jan 20, 2024
86d86f6
Solaris: fix the package FMRI
alex-w Jan 20, 2024
6916729
Solaris: ouch... cmake v3.9 is too old for us
alex-w Jan 20, 2024
ae4aa58
[test] get system info
alex-w Jan 28, 2024
87efdb6
Removed extra info
alex-w Jan 28, 2024
7b0fd36
fix rounding values
alex-w Jan 28, 2024
b27db06
fix docs
alex-w Jan 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 213 additions & 0 deletions .github/workflows/ci-unix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
#
# Implementation of Continuous Integration process for UNIX by Github actions (with extra additionals...)
#
name: "CI"

on:
push:
pull_request:
# The branches below must be a subset of the branches above
branches: [master]

jobs:
ci-freebsd-qt5:
name: "FreeBSD (x86_64; qt5)"
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.actor, 'transifex')"

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

- name: Build and run unit tests in FreeBSD
uses: vmactions/freebsd-vm@v1
id: freebsd-qt5
with:
# Use sh shell
usesh: true
# When using rsync, you can define copyback: false to not copy files back from the VM in to the host.
copyback: false
prepare: |
pkg install -y cmake eigen glm exiv2 nlopt perl5 xorg-vfbserver gettext qt5-buildtools qt5-charts qt5-concurrent qt5-core qt5-declarative qt5-gui qt5-script qt5-serialport qt5-qmake qt5-webengine qt5-widgets qt5-testlib qt5-linguisttools qt5-location qt5-network qt5-multimedia qt5-opengl qt5-webchannel

run: |
set -e -x
export DISPLAY=:0
mkdir builds
cd builds
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=On "${{ github.workspace }}"
make -j3
Xvfb :0 -ac -screen 0 1024x768x24+32 >/dev/null 2>&1 &
sleep 3
ctest --output-on-failure
sleep 1
pkill Xvfb

ci-freebsd-qt6:
name: "FreeBSD (x86_64; qt6)"
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.actor, 'transifex')"

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

- name: Build and run unit tests in FreeBSD
uses: vmactions/freebsd-vm@v1
id: freebsd-qt6
with:
# Use sh shell
usesh: true
# When using rsync, you can define copyback: false to not copy files back from the VM in to the host.
copyback: false
prepare: |
pkg install -y cmake eigen glm exiv2 nlopt perl5 xorg-vfbserver gettext qt6-webengine qt6-base qt6-tools qt6-serialport qt6-location qt6-positioning qt6-multimedia qt6-charts

run: |
set -e -x
export DISPLAY=:0
mkdir builds
cd builds
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=On "${{ github.workspace }}"
make -j3
Xvfb :0 -ac -screen 0 1024x768x24+32 >/dev/null 2>&1 &
sleep 3
ctest --output-on-failure
sleep 1
pkill Xvfb

ci-openbsd-qt5:
name: "OpenBSD (x86_64; qt5)"
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.actor, 'transifex')"

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

- name: Build and run unit tests in OpenBSD
uses: vmactions/openbsd-vm@v1
id: openbsd-qt5
with:
# Use sh shell
usesh: true
# When using rsync, you can define copyback: false to not copy files back from the VM in to the host.
copyback: false
prepare: |
pkg_add -aU cmake eigen3 glm exiv2 nlopt gpsd qt5-qxlsx qt5 gettext-runtime gettext-tools

run: |
set -e -x
#export Qt5_DIR=/usr/local/lib/qt5/cmake/Qt5
#export Qt5Script_DIR=/usr/local/lib/qt5/cmake/Qt5Script
#export Qt5LinguistTools_DIR=/usr/local/lib/qt5/cmake/Qt5LinguistTools
export PATH=$PATH:/usr/local/lib/qt5/bin
export DISPLAY=:0
mkdir builds
cd builds
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/lib/qt5/cmake -DENABLE_TESTING=On -DENABLE_QTWEBENGINE=Off "${{ github.workspace }}"
make -j3
Xvfb :0 -ac -screen 0 1024x768x24+32 >/dev/null 2>&1 &
sleep 3
ctest --output-on-failure
sleep 1
pkill Xvfb

ci-openbsd-qt6:
name: "OpenBSD (x86_64; qt6)"
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.actor, 'transifex')"

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

- name: Build and run unit tests in OpenBSD
uses: vmactions/openbsd-vm@v1
id: openbsd-qt6
with:
# Use sh shell
usesh: true
# When using rsync, you can define copyback: false to not copy files back from the VM in to the host.
copyback: false
prepare: |
pkg_add -aU cmake eigen3 glm exiv2 nlopt gpsd qt6-qxlsx qt6 gettext-runtime gettext-tools

run: |
set -e -x
export DISPLAY=:0
mkdir builds
cd builds
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=On -DENABLE_QTWEBENGINE=Off "${{ github.workspace }}"
make -j3
Xvfb :0 -ac -screen 0 1024x768x24+32 >/dev/null 2>&1 &
sleep 3
ctest --output-on-failure
sleep 1
pkill Xvfb

ci-dragonflybsd-qt5:
name: "DragonflyBSD (x86_64; qt5)"
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.actor, 'transifex')"

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

- name: Build and run unit tests in DragonflyBSD
uses: vmactions/dragonflybsd-vm@v1
id: dragonflybsd-qt5
with:
# Use sh shell
usesh: true
# When using rsync, you can define copyback: false to not copy files back from the VM in to the host.
copyback: false
prepare: |
pkg install -y cmake gettext perl5 xorg-vfbserver qt5-buildtools qt5-charts qt5-concurrent qt5-core qt5-declarative qt5-gui qt5-linguisttools qt5-location qt5-multimedia qt5-network qt5-opengl qt5-qmake qt5-script qt5-serialport qt5-testlib qt5-webengine

run: |
set -e -x
export DISPLAY=:0
mkdir builds
cd builds
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=On -DENABLE_SHOWMYSKY=Off -DUSE_PLUGIN_LENSDISTORTIONESTIMATOR=Off "${{ github.workspace }}"
make -j3
Xvfb :0 -ac -screen 0 1024x768x24+32 >/dev/null 2>&1 &
sleep 3
ctest --output-on-failure
sleep 1
pkill Xvfb

ci-dragonflybsd-qt6:
name: "DragonflyBSD (x86_64; qt6)"
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.actor, 'transifex')"

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

- name: Build and run unit tests in DragonflyBSD
uses: vmactions/dragonflybsd-vm@v1
id: dragonflybsd-qt6
with:
# Use sh shell
usesh: true
# When using rsync, you can define copyback: false to not copy files back from the VM in to the host.
copyback: false
prepare: |
pkg install -y cmake perl5 xorg-vfbserver gettext qt6-base qt6-tools qt6-serialport qt6-positioning qt6-multimedia qt6-charts qt6-declarative

run: |
set -e -x
export DISPLAY=:0
mkdir builds
cd builds
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=On -DENABLE_SHOWMYSKY=Off -DUSE_PLUGIN_LENSDISTORTIONESTIMATOR=Off -DENABLE_QTWEBENGINE=Off "${{ github.workspace }}"
make -j3
Xvfb :0 -ac -screen 0 1024x768x24+32 >/dev/null 2>&1 &
sleep 3
ctest --output-on-failure
sleep 1
pkill Xvfb
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,8 @@ SET(CMAKE_INCLUDE_CURRENT_DIR ON)
IF(ENABLE_SHOWMYSKY)
ADD_DEFINITIONS(-DENABLE_SHOWMYSKY)
CPMFindPackage(NAME ShowMySky-Qt${QT_VERSION_MAJOR}
URL https://github.com/10110111/CalcMySky/archive/refs/tags/v0.3.1.tar.gz
URL_HASH SHA256=d284eaabcf21ad3d1f520a1d1b1b533f7c5f5a44ba92495dd38e238874e8e4d7
URL https://codeload.github.com/10110111/CalcMySky/zip/refs/heads/master
# URL_HASH SHA256=d284eaabcf21ad3d1f520a1d1b1b533f7c5f5a44ba92495dd38e238874e8e4d7
EXCLUDE_FROM_ALL yes
OPTIONS "QT_VERSION ${QT_VERSION_MAJOR}")
IF(ShowMySky-Qt${QT_VERSION_MAJOR}_ADDED)
Expand Down
4 changes: 0 additions & 4 deletions src/StelLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,7 @@ void StelLogger::init(const QString& logFilePath)
dmesg.waitForStarted();
dmesg.waitForFinished();
const QString dmesgData(dmesg.readAll());
#if (QT_VERSION>=QT_VERSION_CHECK(5, 14, 0))
alex-w marked this conversation as resolved.
Show resolved Hide resolved
QStringList dmesgLines = dmesgData.split('\n', QString::SkipEmptyParts);
#else
QStringList dmesgLines = dmesgData.split('\n', Qt::SkipEmptyParts);
#endif
for (int i = 0; i<dmesgLines.size(); i++)
{
if (dmesgLines.at(i).contains("memory"))
Expand Down
2 changes: 1 addition & 1 deletion src/core/OctahedronPolygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ struct OctTessTrianglesCallbackData
void errorCallback(GLenum errn)
{
qWarning() << "Tessellator error:" << QString::fromLatin1(reinterpret_cast<const char*>(gluesErrorString(errn)));
Q_ASSERT(0);
//Q_ASSERT(0);
}

void vertexTrianglesCallback(Vec3d* vertexData, OctTessTrianglesCallbackData* userData)
Expand Down
10 changes: 6 additions & 4 deletions src/core/StelLocationMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,19 +1078,21 @@ void StelLocationMgr::changeLocationFromGPSQuery(const StelLocation &locin)
const bool verbose=qApp->property("verbose").toBool();
StelCore *core=StelApp::getInstance().getCore();
StelLocation loc=locin;
const float latitude = loc.getLatitude();
const float longitude = loc.getLongitude();
loc.lightPollutionLuminance=StelLocation::DEFAULT_LIGHT_POLLUTION_LUMINANCE;
// Usually you don't leave your time zone with GPS.
loc.ianaTimeZone=core->getCurrentTimeZone();
loc.isUserLocation=true;
loc.planetName="Earth";
loc.name=QString("GPS %1%2 %3%4")
.arg(loc.getLatitude()<0?"S":"N").arg(qRound(abs(loc.getLatitude())))
.arg(loc.getLongitude()<0?"W":"E").arg(qRound(abs(loc.getLongitude())));
.arg(latitude<0.f?"S":"N").arg(qRound(qAbs(latitude)))
.arg(longitude<0.f?"W":"E").arg(qRound(qAbs(longitude)));
LandscapeMgr *lMgr=GETSTELMODULE(LandscapeMgr);
QString landscapeAutoName;
if (lMgr->getFlagLandscapeAutoSelection())
{
QColor color=getColorForCoordinates(loc.getLongitude(), loc.getLatitude());
QColor color=getColorForCoordinates(longitude, latitude);
landscapeAutoName=QString("ZeroColor(%1)").arg(Vec3f(color).toStr());
}
core->moveObserverTo(loc, 0.0, 0.0, landscapeAutoName);
Expand All @@ -1101,7 +1103,7 @@ void StelLocationMgr::changeLocationFromGPSQuery(const StelLocation &locin)
}
if (verbose)
{
qDebug() << "Location in progress: Long=" << loc.getLongitude() << " Lat=" << loc.getLatitude() << " Alt" << loc.altitude;
qDebug() << "Location in progress: Long=" << longitude << " Lat=" << latitude << " Alt" << loc.altitude;
qDebug() << "New location named " << loc.name;
qDebug() << "queryOK, resetting GUI";
}
Expand Down
20 changes: 14 additions & 6 deletions src/scripting/V3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ V3d & V3d::operator =(const V3d &v)
QString V3d::toHex() const
{
return QString("#%1%2%3")
.arg(qMin(255, int(m_x * 255)), 2, 16, QChar('0'))
.arg(qMin(255, int(m_y * 255)), 2, 16, QChar('0'))
.arg(qMin(255, int(m_z * 255)), 2, 16, QChar('0'));
.arg(qMin(255, qRound(m_x * 255)), 2, 16, QChar('0'))
.arg(qMin(255, qRound(m_y * 255)), 2, 16, QChar('0'))
.arg(qMin(255, qRound(m_z * 255)), 2, 16, QChar('0'));
}

/////////////////////
Expand All @@ -63,6 +63,14 @@ V3f & V3f::operator =(const V3f &v)
return *this;
}

QString V3f::toHex() const
{
return QString("#%1%2%3")
.arg(qMin(255, qRound(m_x * 255)), 2, 16, QChar('0'))
.arg(qMin(255, qRound(m_y * 255)), 2, 16, QChar('0'))
.arg(qMin(255, qRound(m_z * 255)), 2, 16, QChar('0'));
}

///////////////////////
#ifdef ENABLE_SCRIPT_QML

Expand Down Expand Up @@ -100,8 +108,8 @@ Color::Color(QString hexColor) : QObject()
QString Color::toHex() const
{
return QString("#%1%2%3")
.arg(qMin(255, int(m_r * 255)), 2, 16, QChar('0'))
.arg(qMin(255, int(m_g * 255)), 2, 16, QChar('0'))
.arg(qMin(255, int(m_b * 255)), 2, 16, QChar('0'));
.arg(qMin(255, qRound(m_r * 255)), 2, 16, QChar('0'))
.arg(qMin(255, qRound(m_g * 255)), 2, 16, QChar('0'))
.arg(qMin(255, qRound(m_b * 255)), 2, 16, QChar('0'));
}
#endif
4 changes: 3 additions & 1 deletion src/scripting/V3d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public slots:
//! Formats a comma-separated string in angle brackets
//! @todo currently this seems to to nothing. JS print output shows "V3d(address)". Use toVec3d() to show the values formatted by Vec3d's method.
Q_INVOKABLE QString toString() const {return QString("[%1, %2, %3]").arg(m_x).arg(m_y).arg(m_z);}
//! Formats a hex string
//! Formats a hex string usable as HTML color
Q_INVOKABLE QString toHex() const;
private:
double m_x, m_y, m_z;
Expand Down Expand Up @@ -122,6 +122,8 @@ public slots:
//! Formats a comma-separated string in angle brackets
//! @todo currently this seems to to nothing. JS print output shows "V3f(address)". Use toVec3f() to show the values formatted by Vec3f's method.
Q_INVOKABLE QString toString() const {return QString("[%1, %2, %3]").arg(m_x).arg(m_y).arg(m_z);}
//! Formats a hex string usable as HTML color
Q_INVOKABLE QString toHex() const;
private:
float m_x, m_y, m_z;
};
Expand Down
Loading
Loading