Skip to content

Commit

Permalink
Merge pull request #6705 from nextcloud/ci/fixWindowsCi
Browse files Browse the repository at this point in the history
use windows-2022 image to run our windows CI on github actions
  • Loading branch information
mgallien committed May 15, 2024
2 parents 1b9fbb0 + a3083f8 commit 42ed8b4
Show file tree
Hide file tree
Showing 66 changed files with 510 additions and 86 deletions.
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
Expand Up @@ -1685,6 +1685,7 @@ void ProcessDirectoryJob::processFileFinalize(

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
Expand Up @@ -1131,7 +1131,8 @@ void PropagateDownloadFile::contentChecksumComputed(const QByteArray &checksumTy
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 @@ -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 @@ class TestAccount: public QObject
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 @@ -205,6 +205,11 @@ class TestActivityData : public QObject
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 @@ -32,6 +32,13 @@ class TestAllFilesDeleted : public QObject
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 @@ -47,6 +47,13 @@ class TestAsyncOp : public QObject
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 @@ -23,6 +23,14 @@ class TestBlacklist : public QObject
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>

#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 @@ -81,6 +81,11 @@ class TestCfApiShellExtensionsIPC : public QObject
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 @@ private slots:
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 @@ -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 @@ using namespace OCC::Utility;
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 @@ -12,6 +12,7 @@
#include <common/constants.h>

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

using namespace OCC;

Expand All @@ -25,6 +26,14 @@ class TestClientSideEncryption : public QObject
}

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

0 comments on commit 42ed8b4

Please sign in to comment.