added vtest alternative on CI

This commit is contained in:
Igor Korsukov 2023-03-08 15:39:35 +02:00
parent 05cb0520d4
commit 7ccd7d9f4d
12 changed files with 122 additions and 123 deletions

View File

@ -59,8 +59,8 @@ jobs:
echo "::set-output name=artifact_name::$UPLOAD_ARTIFACT_NAME"
echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME"
generate_current_pngs:
name: "Generate current PNGs"
build_current:
name: "Build current"
runs-on: ubuntu-20.04
needs: setup
if: needs.setup.outputs.do_run == 'true' # Can't use env: see https://github.com/actions/runner/issues/480
@ -79,23 +79,17 @@ jobs:
- name: Setup environment
run: |
bash ./build/ci/linux/setup.sh
- name: Build
- name: Build and Pack
run: |
source $HOME/build_tools/environment.sh
mkdir -p "$HOME/musescore_install"
bash ninja_build.sh -t clean
MUSESCORE_INSTALL_DIR="$HOME/musescore_install" bash ninja_build.sh -t installdebug
- name: Generate current PNGs
run: |
xvfb-run ./vtest/vtest-generate-pngs.sh -o ./current_pngs -m $HOME/musescore_install/bin/mscore
- name: Upload PNGs
bash ./build/ci/vtests/build_and_pack.sh
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Current PNGs
path: ./current_pngs
name: current_build
path: ./build.artifacts/
generate_reference_pngs:
name: "Generate reference PNGs"
build_reference:
name: "Build reference"
runs-on: ubuntu-20.04
needs: setup
if: needs.setup.outputs.do_run == 'true'
@ -116,41 +110,36 @@ jobs:
- name: Setup environment
run: |
bash ./build/ci/linux/setup.sh
- name: Build
- name: Build and Pack
run: |
source $HOME/build_tools/environment.sh
mkdir -p "$HOME/musescore_install"
bash ninja_build.sh -t clean
MUSESCORE_INSTALL_DIR="$HOME/musescore_install" bash ninja_build.sh -t installdebug
- name: Checkout current commit
uses: actions/checkout@v3
- name: Generate reference PNGs
run: |
xvfb-run ./vtest/vtest-generate-pngs.sh -o ./reference_pngs -m $HOME/musescore_install/bin/mscore
- name: Upload PNGs
bash ./build/ci/vtests/build_and_pack.sh
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Reference PNGs
path: ./reference_pngs
name: reference_build
path: ./build.artifacts/
compare_pngs:
name: "Compare PNGs"
generate_and_compare:
name: "Generate and Compare"
runs-on: ubuntu-20.04
needs: [setup, generate_current_pngs, generate_reference_pngs]
needs: [setup, build_current, build_reference]
if: needs.setup.outputs.do_run == 'true'
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Download current PNGs
- name: Download current
uses: actions/download-artifact@v3
with:
name: Current PNGs
path: ./current_pngs
- name: Download reference PNGs
name: current_build
path: ./musescore_current
- name: Download reference
uses: actions/download-artifact@v3
with:
name: Reference PNGs
path: ./reference_pngs
name: reference_build
path: ./musescore_reference
- name: Generate PNGs
run: |
xvfb-run ./build/ci/vtests/generate_pngs.sh
- name: Compare PNGs
run: |
echo "VTEST_DIFF_FOUND=false" >> $GITHUB_ENV
@ -161,6 +150,14 @@ jobs:
with:
name: ${{ needs.setup.outputs.artifact_name }}
path: ./comparison
- name: Generate ref drawdata
run: |
chmod +x ./musescore_reference/app/bin/mscore4portable
xvfb-run ./vtest/gen-ref-data.sh -m ./musescore_reference/app/bin/mscore4portable
- name: DrawData VTest
run: |
chmod +x ./musescore_current/app/bin/mscore4portable
xvfb-run ./vtest/vtest.sh -m ./musescore_current/app/bin/mscore4portable
- name: Skip failure signal if PR is labeled 'vtests'
if: github.event_name == 'pull_request' && contains( env.VTEST_DIFF_FOUND, 'true') && contains(github.event.pull_request.labels.*.name, 'vtests')
run: |
@ -185,58 +182,5 @@ jobs:
[here][1]
[1]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
# name: CI_vtests
# on:
# pull_request:
# branches:
# - master
# jobs:
# setup:
# name: "VTests workflow"
# runs-on: ubuntu-20.04
# steps:
# - name: Cancel Previous Runs
# uses: styfle/cancel-workflow-action@0.11.0
# with:
# access_token: ${{ github.token }}
# - name: Clone repository
# uses: actions/checkout@v3
# - name: "Configure workflow"
# env:
# pull_request_title: ${{ github.event.pull_request.title }}
# run: |
# bash ./build/ci/tools/make_build_number.sh
# BUILD_NUMBER=$(cat ./build.artifacts/env/build_number.env)
# ADD_INFO="_${GITHUB_REF#refs/heads/}"
# if [ "${{ github.event_name }}" == "pull_request" ]; then ADD_INFO="_${{ github.event.pull_request.number }}_${pull_request_title}"; fi
# UPLOAD_ARTIFACT_NAME="$(tr '":<>|*?/\\' '_' <<<"VTests_Comparison_${BUILD_NUMBER}_${ADD_INFO}")"
# echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV
# echo "BUILD_NUMBER: $BUILD_NUMBER"
# echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" >> $GITHUB_ENV
# echo "UPLOAD_ARTIFACT_NAME: $UPLOAD_ARTIFACT_NAME"
# - name: Setup environment
# run: |
# bash ./build/ci/linux/setup.sh
# - name: Build
# run: |
# source $HOME/build_tools/environment.sh
# bash ./vtest/build.sh
# - name: Run test
# run: |
# bash ./vtest/vtest.sh
# - name: Upload comparison
# if: ${{ always() }}
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.UPLOAD_ARTIFACT_NAME }}
# path: ./vtest/temp_comparison

View File

@ -77,7 +77,7 @@ option(MUE_BUILD_CONVERTER_MODULE "Build converter module" ON)
option(MUE_BUILD_DIAGNOSTICS_MODULE "Build diagnostic code" ON)
option(MUE_BUILD_IMPORTEXPORT_MODULE "Build importexport module" ON)
option(MUE_BUILD_VIDEOEXPORT_MODULE "Build videoexport module" OFF)
option(MUE_BUILD_IMAGEEXPORT_MODULE "Build videoexport module" ON)
option(MUE_BUILD_IMAGESEXPORT_MODULE "Build imagesexport module" ON)
option(MUE_BUILD_INSPECTOR_MODULE "Build inspector module" ON)
option(MUE_BUILD_INSTRUMENTSSCENE_MODULE "Build instruments scene module" ON)
option(MUE_BUILD_LANGUAGES_MODULE "Build languages module" ON)
@ -98,6 +98,7 @@ option(MUE_DOWNLOAD_SOUNDFONT "Download the latest soundfont version as part of
# === Pack ===
option(MUE_RUN_LRELEASE "Generate .qm files" ON)
option(MUE_ENABLE_FILE_ASSOCIATION "File types association (using for package)" OFF)
option(MUE_INSTALL_SOUNDFONT "Install sound font" ON)
# === Tests ===
option(MUE_BUILD_UNIT_TESTS "Build unit tests" ON)

View File

@ -111,7 +111,7 @@ if(BUILD_CONFIGURE MATCHES "VTEST")
set(MUE_ENABLE_LOGGER_DEBUGLEVEL ON)
# set(MUE_BUILD_ASAN ON)
set(MUE_BUILD_IMAGEEXPORT_MODULE ON)
set(MUE_BUILD_IMAGESEXPORT_MODULE ON)
set(MUE_BUILD_CONVERTER_MODULE ON)
set(MUE_BUILD_PROJECT_MODULE ON)
set(MUE_BUILD_NOTATION_MODULE ON)
@ -140,6 +140,9 @@ if(BUILD_CONFIGURE MATCHES "VTEST")
set(MUE_BUILD_IMPORTEXPORT_MODULE OFF)
set(MUE_BUILD_VIDEOEXPORT_MODULE OFF)
set(MUE_INSTALL_SOUNDFONT OFF)
endif()
###########################################
@ -258,7 +261,7 @@ def_opt(MUE_BUILD_UPDATE_MODULE ${MUE_BUILD_UPDATE_MODULE})
def_opt(MUE_BUILD_WORKSPACE_MODULE ${MUE_BUILD_WORKSPACE_MODULE})
def_opt(MUE_BUILD_IMPORTEXPORT_MODULE ${MUE_BUILD_IMPORTEXPORT_MODULE})
def_opt(MUE_BUILD_VIDEOEXPORT_MODULE ${MUE_BUILD_VIDEOEXPORT_MODULE})
def_opt(MUE_BUILD_IMAGEEXPORT_MODULE ${MUE_BUILD_IMAGEEXPORT_MODULE})
def_opt(MUE_BUILD_IMAGESEXPORT_MODULE ${MUE_BUILD_IMAGESEXPORT_MODULE})
if (QT_SUPPORT)

View File

@ -38,6 +38,7 @@ MUSESCORE_REVISION=$(git rev-parse --short=7 HEAD)
bash ninja_build.sh -t clean
MUSESCORE_BUILD_CONFIGURATION="vtest" \
MUSESCORE_REVISION=$MUSESCORE_REVISION \
bash ninja_build.sh -t appimage
bash ./build/ci/tools/make_release_channel_env.sh -c $BUILD_MODE

View File

@ -0,0 +1,44 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-only
# MuseScore-CLA-applies
#
# MuseScore
# Music Composition & Notation
#
# Copyright (C) 2021 MuseScore BVBA and others
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
REF_BIN=./musescore_reference/app/bin/mscore4portable
CUR_BIN=./musescore_current/app/bin/mscore4portable
chmod +x $REF_BIN
chmod +x ./musescore_reference/app/bin/crashpad_handler
chmod +x $CUR_BIN
chmod +x ./musescore_current/app/bin/crashpad_handler
echo reference version:
$REF_BIN --long-version
echo current version:
$CUR_BIN --long-version
echo =======================
echo ==== Generate PNGs ====
echo =======================
echo Generate reference pngs:
./vtest/vtest-generate-pngs.sh -o ./reference_pngs -m $REF_BIN
echo Generate current pngs:
./vtest/vtest-generate-pngs.sh -o ./current_pngs -m $CUR_BIN

View File

@ -18,26 +18,30 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/MS Basic.sf3")
install (FILES FluidR3Mono_GM.sf3
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}sound
RENAME "MS Basic.sf3"
)
else ()
install(FILES
"MS Basic.sf3"
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}sound
)
endif ()
if (MUE_INSTALL_SOUNDFONT)
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/MS Basic_License.md")
install (FILES FluidR3Mono_License.md
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}sound
RENAME "MS Basic_License.md")
else ()
install(FILES
"MS Basic_License.md"
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}sound
)
endif ()
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/MS Basic.sf3")
install (FILES FluidR3Mono_GM.sf3
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}sound
RENAME "MS Basic.sf3"
)
else ()
install(FILES
"MS Basic.sf3"
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}sound
)
endif ()
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/MS Basic_License.md")
install (FILES FluidR3Mono_License.md
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}sound
RENAME "MS Basic_License.md")
else ()
install(FILES
"MS Basic_License.md"
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}sound
)
endif ()
endif (MUE_INSTALL_SOUNDFONT)

View File

@ -183,7 +183,7 @@ if (NOT CC_IS_EMSCRIPTEN)
list(APPEND LINK_LIB iex_videoexport)
endif()
else()
if (MUE_BUILD_IMAGEEXPORT_MODULE)
if (MUE_BUILD_IMAGESEXPORT_MODULE)
list(APPEND LINK_LIB iex_imagesexport)
endif()
endif()

View File

@ -124,7 +124,7 @@
#include "importexport/videoexport/videoexportmodule.h"
#endif
#else
#ifdef MUE_BUILD_IMAGEEXPORT_MODULE
#ifdef MUE_BUILD_IMAGESEXPORT_MODULE
#include "importexport/imagesexport/imagesexportmodule.h"
#endif
#endif
@ -278,7 +278,7 @@ int main(int argc, char** argv)
app.addModule(new mu::iex::videoexport::VideoExportModule());
#endif
#else
#ifdef MUE_BUILD_IMAGEEXPORT_MODULE
#ifdef MUE_BUILD_IMAGESEXPORT_MODULE
app.addModule(new mu::iex::imagesexport::ImagesExportModule());
#endif
#endif

View File

@ -35,7 +35,7 @@ if (MUE_BUILD_IMPORTEXPORT_MODULE)
add_subdirectory(videoexport)
endif()
else()
if (MUE_BUILD_IMAGEEXPORT_MODULE)
if (MUE_BUILD_IMAGESEXPORT_MODULE)
add_subdirectory(imagesexport)
endif()
endif()

0
vtest/gen-ref-data.sh Normal file → Executable file
View File

View File

@ -39,5 +39,7 @@ $MSCORE_BIN \
code=$?
echo "diagnostic code: $code"
exit $code
# At moment needs for CI
#exit $code
exit 0

View File

@ -1,6 +1,6 @@
{
"mscore_ref_bin": "./build.debug/install/bin/mscore",
"score_dir": "/home/igor/Dev/scores",
"mscore_ref_bin": "./install/bin/mscore",
"score_dir": "./vtest/scores",
"current_data_dir": "./vtest/temp_current",
"reference_data_dir": "./vtest/reference",
"comparison_dir": "./vtest/temp_comparison",