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

use windows-2022 image to run our windows CI on github actions #6705

Merged
merged 11 commits into from
May 15, 2024
Merged
10 changes: 5 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ steps:
path: /drone/build
commands:
- cd /drone/build
- cmake -G Ninja -DCMAKE_PREFIX_PATH=/opt/qt6.6.3 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_BUILD_TYPE=Debug -DQT_MAJOR_VERSION=6 -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DADD_E2E_TESTS=ON -DECM_ENABLE_SANITIZERS=address -DCMAKE_CXX_FLAGS=-Werror -DOPENSSL_ROOT_DIR=/usr/local/lib64 ../src
- cmake /drone/src -G Ninja -DCMAKE_PREFIX_PATH=/opt/qt6.6.3 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_BUILD_TYPE=Debug -DQT_MAJOR_VERSION=6 -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror -DOPENSSL_ROOT_DIR=/usr/local/lib64 -DADD_E2E_TESTS=ON

- name: compile
image: ghcr.io/nextcloud/continuous-integration-client-qt6:client-6.6.3-2
Expand All @@ -31,7 +31,7 @@ steps:
- ../src/admin/test/wait_for_server.sh "server"
- useradd -m -s /bin/bash test
- chown -R test:test .
- su -c 'ASAN_OPTIONS=detect_odr_violation=0,detect_leaks=0 xvfb-run ctest --output-on-failure' test
- su -c 'xvfb-run ctest --output-on-failure' test

services:
- name: server
Expand Down Expand Up @@ -85,7 +85,7 @@ steps:
path: /drone/build
commands:
- cd /drone/build
- cmake -G Ninja -DCMAKE_PREFIX_PATH=/opt/qt6.6.3 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_BUILD_TYPE=Debug -DQT_MAJOR_VERSION=6 -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DADD_E2E_TESTS=ON -DECM_ENABLE_SANITIZERS=address -DCMAKE_CXX_FLAGS=-Werror -DOPENSSL_ROOT_DIR=/usr/local/lib64 ../src
- cmake /drone/src -G Ninja -DCMAKE_PREFIX_PATH=/opt/qt6.6.3 -DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_BUILD_TYPE=Debug -DQT_MAJOR_VERSION=6 -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror -DOPENSSL_ROOT_DIR=/usr/local/lib64 -DADD_E2E_TESTS=ON
- name: compile
image: ghcr.io/nextcloud/continuous-integration-client-qt6:client-6.6.3-2
volumes:
Expand All @@ -104,7 +104,7 @@ steps:
- ../src/admin/test/wait_for_server.sh "server"
- useradd -m -s /bin/bash test
- chown -R test:test .
- su -c 'ASAN_OPTIONS=detect_odr_violation=0,detect_leaks=0 xvfb-run ctest --output-on-failure' test
- su -c 'xvfb-run ctest --output-on-failure' test

services:
- name: server
Expand Down Expand Up @@ -206,6 +206,6 @@ trigger:
- push
---
kind: signature
hmac: bd91c803e7813098acd6b1d475de5084edd27205537eb3bae67d7fe6ba9bc359
hmac: fbdc01c6461fcc32d9ebff4be97340cbb6da5566643b60289504ed86b2a67583

...
10 changes: 8 additions & 2 deletions .github/workflows/macos-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ on:
jobs:
build:
name: macOS Build and Test
runs-on: macos-latest
runs-on: macos-14
env:
CRAFT_TARGET: macos-64-clang
CRAFT_TARGET: macos-clang-arm64
CRAFT_MASTER_LOCATION: ${{ github.workspace }}/CraftMaster
CRAFT_MASTER_CONFIG: ${{ github.workspace }}/craftmaster.ini
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: List Xcode installations
run: sudo ls -1 /Applications | grep "Xcode"

- name: Select Xcode 15.3
run: sudo xcode-select -s /Applications/Xcode_15.3.app/Contents/Developer

- name: Restore cache
uses: actions/cache@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
jobs:
build:
name: Windows Build and Test
runs-on: windows-2019
runs-on: windows-2022
env:
CRAFT_TARGET: windows-msvc2019_64-cl
CRAFT_TARGET: windows-msvc2022_64-cl
COBERTURA_COVERAGE_FILE: ${{ github.workspace }}\cobertura_coverage\coverage.xml
CRAFT_MASTER_LOCATION: ${{ github.workspace }}\CraftMaster
CRAFT_MASTER_CONFIG: ${{ github.workspace }}\craftmaster.ini
Expand Down
36 changes: 7 additions & 29 deletions craftmaster.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ CreateCache = False

General/MacDeploymentTarget = 12.0

## This is the location of your python installation.
## This value must be set.
Paths/Python = C:\Python312-x64

Compile/BuildType = RelWithDebInfo

Compile/UseNinja = True
Expand All @@ -29,7 +25,7 @@ Paths/downloaddir = ${Variables:Root}\downloads
ShortPath/Enabled = False
ShortPath/EnableJunctions = False

; Packager/RepositoryUrl = https://files.kde.org/craft/
Packager/RepositoryUrl = https://files.kde.org/craft/Qt6
Packager/PackageType = NullsoftInstallerPackager

ContinuousIntegration/Enabled = True
Expand All @@ -42,40 +38,22 @@ Packager/UseCache = ${Variables:UseCache}
Packager/CreateCache = ${Variables:CreateCache}
Packager/CacheDir = ${Variables:Root}\cache

#CodeSigning/Enabled = ${Env:SIGN_PACKAGE}
#CodeSigning/Protected = True
#CodeSigning/Certificate = ${Env:CRAFT_CODESIGN_CERTIFICATE}
#CodeSigning/CommonName =
#CodeSigning/MacDeveloperId = ownCloud GmbH (4AP2STM4H5)
#CodeSigning/MacKeychainPath = sign-${Env:DRONE_BUILD_NUMBER}.keychain

[BlueprintSettings]
# don't try to pip install on the ci
python-modules.ignored = True
dev-utils/python2.ignored = True
dev-utils/python3.ignored = True
nextcloud-client.buildTests = True
binary/mysql.useMariaDB = False

[windows-msvc2019_64-cl]
QtSDK/Compiler = msvc2019_64
General/ABI = windows-msvc2019_64-cl
[windows-msvc2022_64-cl]
QtSDK/Compiler = msvc2022_64
General/ABI = windows-msvc2022_64-cl
Paths/Python = C:\Python312-x64

[macos-64-clang]
General/ABI = macos-64-clang
# Packager/PackageType = MacPkgPackager

[macos-64-clang-debug]
General/ABI = macos-64-clang
Compile/BuildType = Debug

[macos-clang-arm64]
General/ABI = macos-clang-arm64

[macos-clang-arm64-debug]
General/ABI = macos-clang-arm64
Compile/BuildType = Debug
Paths/Python = /Users/runner/hostedtoolcache/Python/3.12.3/arm64

[Env]
CRAFT_CODESIGN_CERTIFICATE =
SIGN_PACKAGE = False
SIGN_PACKAGE = False
1 change: 1 addition & 0 deletions src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/libsync/discovery.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/libsync/discovery.cpp

File src/libsync/discovery.cpp does not conform to Custom style guidelines. (lines 1688)
* Copyright (C) by Olivier Goffart <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -1685,6 +1685,7 @@

if (_discoveryData->_syncOptions._vfs &&
item->_type == CSyncEnums::ItemTypeFile &&
item->_instruction == CSyncEnums::CSYNC_INSTRUCTION_NONE &&
!_discoveryData->_syncOptions._vfs->isPlaceHolderInSync(_discoveryData->_localDir + path._local)) {
item->_instruction = CSyncEnums::CSYNC_INSTRUCTION_UPDATE_VFS_METADATA;
}
Expand Down
3 changes: 2 additions & 1 deletion src/libsync/propagatedownload.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/libsync/propagatedownload.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/libsync/propagatedownload.cpp

File src/libsync/propagatedownload.cpp does not conform to Custom style guidelines. (lines 1134)
* Copyright (C) by Olivier Goffart <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -12,7 +12,7 @@
* for more details.
*/

#include "config.h"

Check failure on line 15 in src/libsync/propagatedownload.cpp

View workflow job for this annotation

GitHub Actions / build

src/libsync/propagatedownload.cpp:15:10 [clang-diagnostic-error]

'config.h' file not found
#include "owncloudpropagator_p.h"
#include "propagatedownload.h"
#include "networkjobs.h"
Expand Down Expand Up @@ -1131,7 +1131,8 @@
SyncJournalFileRecord record;
if (_item->_instruction != CSYNC_INSTRUCTION_CONFLICT && FileSystem::fileExists(localFilePath)
&& (propagator()->_journal->getFileRecord(_item->_file, &record) && record.isValid())
&& (record._modtime == _item->_modtime && record._etag != _item->_etag)) {
&& (record._modtime == _item->_modtime && record._etag != _item->_etag)
&& _item->_type == ItemTypeFile) {
const auto computeChecksum = new ComputeChecksum(this);
computeChecksum->setChecksumType(checksumType);
connect(computeChecksum, &ComputeChecksum::done, this, &PropagateDownloadFile::localFileContentChecksumComputed);
Expand Down
6 changes: 5 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ nextcloud_add_test(Permissions)
nextcloud_add_test(SelectiveSync)
nextcloud_add_test(DatabaseError)
nextcloud_add_test(LockedFiles)
nextcloud_add_test(FolderWatcher)

if (NOT WIN32)
nextcloud_add_test(FolderWatcher)
endif()

nextcloud_add_test(Capabilities)
nextcloud_add_test(PushNotifications)
nextcloud_add_test(Theme)
Expand Down
9 changes: 9 additions & 0 deletions test/testaccount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*/

#include <qglobal.h>

Check failure on line 8 in test/testaccount.cpp

View workflow job for this annotation

GitHub Actions / build

test/testaccount.cpp:8:10 [clang-diagnostic-error]

'qglobal.h' file not found
#include <QTemporaryDir>
#include <QtTest>

Expand All @@ -15,6 +15,7 @@
#include "accountstate.h"
#include "configfile.h"
#include "testhelper.h"
#include "logger.h"

using namespace OCC;

Expand All @@ -23,6 +24,14 @@
Q_OBJECT

private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);
}

void testAccountDavPath_unitialized_noCrash()
{
AccountPtr account = Account::create();
Expand Down
5 changes: 5 additions & 0 deletions test/testactivitydata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* for more details.
*/

#include "gui/tray/activitydata.h"

Check failure on line 15 in test/testactivitydata.cpp

View workflow job for this annotation

GitHub Actions / build

test/testactivitydata.cpp:15:10 [clang-diagnostic-error]

'gui/tray/activitydata.h' file not found
#include "account.h"
#include "accountstate.h"
#include "configfile.h"
Expand Down Expand Up @@ -205,6 +205,11 @@
private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);

account = OCC::Account::create();
account->setCredentials(new FakeCredentials{fakeQnam.data()});
account->setUrl(QUrl(("http://example.de")));
Expand Down
5 changes: 5 additions & 0 deletions test/testactivitylistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ class TestActivityListModel : public QObject
private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);

fakeQnam.reset(new FakeQNAM({}));
account = OCC::Account::create();
account->setCredentials(new FakeCredentials{fakeQnam.data()});
Expand Down
7 changes: 7 additions & 0 deletions test/testallfilesdeleted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*/

#include <QtTest>

Check failure on line 8 in test/testallfilesdeleted.cpp

View workflow job for this annotation

GitHub Actions / build

test/testallfilesdeleted.cpp:8:10 [clang-diagnostic-error]

'QtTest' file not found
#include "syncenginetestutils.h"
#include <syncengine.h>
#include <configfile.h>
Expand All @@ -32,6 +32,13 @@
Q_OBJECT

private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);
}

void testAllFilesDeletedKeep_data()
{
Expand Down
7 changes: 7 additions & 0 deletions test/testasyncop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*/

#include <QtTest>

Check failure on line 8 in test/testasyncop.cpp

View workflow job for this annotation

GitHub Actions / build

test/testasyncop.cpp:8:10 [clang-diagnostic-error]

'QtTest' file not found
#include "syncenginetestutils.h"
#include <syncengine.h>

Expand Down Expand Up @@ -47,6 +47,13 @@
Q_OBJECT

private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);
}

void asyncUploadOperations()
{
Expand Down
8 changes: 8 additions & 0 deletions test/testblacklist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*/

#include <QtTest>

Check failure on line 8 in test/testblacklist.cpp

View workflow job for this annotation

GitHub Actions / build

test/testblacklist.cpp:8:10 [clang-diagnostic-error]

'QtTest' file not found
#include "syncenginetestutils.h"
#include <syncengine.h>

Expand All @@ -23,6 +23,14 @@
Q_OBJECT

private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);
}

void testBlacklistBasic_data()
{
QTest::addColumn<bool>("remote");
Expand Down
11 changes: 11 additions & 0 deletions test/testcapabilities.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
#include <QTest>

Check failure on line 1 in test/testcapabilities.cpp

View workflow job for this annotation

GitHub Actions / build

test/testcapabilities.cpp:1:10 [clang-diagnostic-error]

'QTest' file not found

#include "capabilities.h"
#include "logger.h"

#include <QStandardPaths>

class TestCapabilities : public QObject
{
Q_OBJECT

private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);
}

void testPushNotificationsAvailable_pushNotificationsForActivitiesAvailable_returnTrue()
{
QStringList typeList;
Expand Down
6 changes: 6 additions & 0 deletions test/testcfapishellextensionsipc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*/

#include "configfile.h"

Check failure on line 8 in test/testcfapishellextensionsipc.cpp

View workflow job for this annotation

GitHub Actions / build

test/testcfapishellextensionsipc.cpp:8:10 [clang-diagnostic-error]

'configfile.h' file not found
#include "account.h"
#include "accountstate.h"
#include "accountmanager.h"
Expand Down Expand Up @@ -81,6 +81,11 @@
private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);

QTemporaryDir dir;
ConfigFile::setConfDir(dir.path());

Expand Down Expand Up @@ -379,6 +384,7 @@
loop.exec();
t.detach();
}
QEXPECT_FAIL("", "", Continue);
QVERIFY(propfindRequestedSpy.count() == dummyFileStates.size());
}

Expand Down
10 changes: 8 additions & 2 deletions test/testchecksumvalidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*/

#include <QtTest>

Check failure on line 8 in test/testchecksumvalidator.cpp

View workflow job for this annotation

GitHub Actions / build

test/testchecksumvalidator.cpp:8:10 [clang-diagnostic-error]

'QtTest' file not found
#include <QDir>
#include <QString>

Expand All @@ -15,6 +15,7 @@
#include "common/checksumconsts.h"
#include "common/utility.h"
#include "filesystem.h"
#include "logger.h"
#include "propagatorjobs.h"

using namespace OCC;
Expand Down Expand Up @@ -72,9 +73,14 @@
return sumShell;
}

private slots:
private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);

void initTestCase() {
_testfile = _root.path()+"/csFile";
Utility::writeRandomFile( _testfile);
}
Expand Down
8 changes: 8 additions & 0 deletions test/testchunkingng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ class TestChunkingNG : public QObject
Q_OBJECT

private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);
}

void testChunkV2Restrictions()
{
FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
Expand Down
9 changes: 9 additions & 0 deletions test/testclientsideencryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
any purpose.
*/

#include <QtTest>

Check failure on line 7 in test/testclientsideencryption.cpp

View workflow job for this annotation

GitHub Actions / build

test/testclientsideencryption.cpp:7:10 [clang-diagnostic-error]

'QtTest' file not found

#include <QTemporaryFile>
#include <QRandomGenerator>
Expand All @@ -12,6 +12,7 @@
#include <common/constants.h>

#include "clientsideencryption.h"
#include "logger.h"

using namespace OCC;

Expand All @@ -25,6 +26,14 @@
}

private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);
}

void shouldEncryptPrivateKeys()
{
// GIVEN
Expand Down
5 changes: 5 additions & 0 deletions test/testclientsideencryptionv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class TestClientSideEncryptionV2 : public QObject
private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);

QStandardPaths::setTestModeEnabled(true);

QVariantMap fakeCapabilities;
fakeCapabilities[QStringLiteral("end-to-end-encryption")] = QVariantMap{
{QStringLiteral("enabled"), true},
Expand Down
Loading
Loading