Skip to content

Commit

Permalink
Turn on NatronTest verification in Build Installer GitHub action.
Browse files Browse the repository at this point in the history
- Added support for running NatronTests as part of the installer build.
- Made mt.exe detection a little more robust.

Signed-off-by: Aaron Colwell <[email protected]>
  • Loading branch information
acolwell committed Jul 19, 2024
1 parent 661ad24 commit 7df36b4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 9 deletions.
37 changes: 33 additions & 4 deletions .github/workflows/build_installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
msystem: mingw64
update: true
install: git mingw-w64-x86_64-wget unzip
install: git mingw-w64-x86_64-wget unzip diffutils

- name: Install Natron pacman repository
run: |
Expand All @@ -42,12 +42,11 @@ jobs:
cd tools/jenkins
WORKSPACE=${NATRON_BUILD_WORKSPACE_UNIX} BUILD_NAME=natron BUILD_NUMBER=1 BITS=64 NATRON_LICENSE=GPL GIT_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git GIT_URL_IS_NATRON=1 SNAPSHOT_BRANCH=${GITHUB_REF_NAME} QT_VERSION_MAJOR=5 DISABLE_BREAKPAD=1 NOUPDATE=1 MKJOBS=$(nproc) MINIMIZE_DISK_USAGE=1 ./launchBuildMain.sh
WORKSPACE=${NATRON_BUILD_WORKSPACE_UNIX} BUILD_NAME=natron BUILD_NUMBER=1 BITS=64 NATRON_LICENSE=GPL GIT_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git GIT_URL_IS_NATRON=1 SNAPSHOT_BRANCH=${GITHUB_REF_NAME} QT_VERSION_MAJOR=5 DISABLE_BREAKPAD=1 NOUPDATE=1 MKJOBS=$(nproc) MINIMIZE_DISK_USAGE=1 UNIT_TESTS=true ./launchBuildMain.sh
ARCHIVE_DIR=${NATRON_BUILD_WORKSPACE_UNIX}/builds_archive/natron/1
INSTALLER_ZIP_UNIX=$(ls ${ARCHIVE_DIR}/Natron*Windows-x86_64.zip)
set -x
# Unzip installer zip for artifact upload so we don't get a zipped zip file.
cd ${ARCHIVE_DIR}
INSTALLER_DIR="${ARCHIVE_DIR}/i"
Expand All @@ -59,6 +58,16 @@ jobs:
echo "INSTALLER_NAME=${INSTALLER_NAME}" >> $GITHUB_OUTPUT
echo "INSTALLER_DIR=$(cygpath -m ${INSTALLER_DIR})" >> $GITHUB_OUTPUT
TEST_RESULTS_FILE="${ARCHIVE_DIR}/${INSTALLER_NAME}-tests.txt"
TEST_RESULTS_NAME="${INSTALLER_NAME}-tests"
echo "TEST_RESULTS_NAME=${TEST_RESULTS_NAME}" >> $GITHUB_OUTPUT
echo "TEST_RESULTS_FILE=$(cygpath -m ${TEST_RESULTS_FILE})" >> $GITHUB_OUTPUT
TEST_FAILURES_DIR="${ARCHIVE_DIR}/${INSTALLER_NAME}-unit_tests_failures"
TEST_FAILURES_NAME="${INSTALLER_NAME}-unit_tests_failures"
echo "TEST_FAILURES_NAME=${TEST_FAILURES_NAME}" >> $GITHUB_OUTPUT
echo "TEST_FAILURES_DIR=$(cygpath -m ${TEST_FAILURES_DIR})" >> $GITHUB_OUTPUT
- name: Build verify_plugin_loads binary
run: |
g++ -DWINDOWS -o verify_plugin_loads .github/workflows/verify_plugin_loads.cpp libs/OpenFX/HostSupport/src/ofxhBinary.cpp libs/OpenFX/HostSupport/src/ofxhUtilities.cpp -I libs/OpenFX/HostSupport/include/ -I libs/OpenFX/include/
Expand All @@ -67,12 +76,24 @@ jobs:
run: |
pacman -Rs --noconfirm mingw-w64-x86_64-natron-build-deps-qt5
- name: Upload artifacts
- name: Upload installer
uses: actions/[email protected]
with:
name: ${{ steps.build.outputs.INSTALLER_NAME }}
path: ${{ steps.build.outputs.INSTALLER_DIR }}

- name: Upload test results
uses: actions/[email protected]
with:
name: ${{ steps.build.outputs.TEST_RESULTS_NAME }}
path: ${{ steps.build.outputs.TEST_RESULTS_FILE }}

- name: Upload test failures
uses: actions/[email protected]
with:
name: ${{ steps.build.outputs.TEST_FAILURES_NAME }}
path: ${{ steps.build.outputs.TEST_FAILURES_DIR }}

- name: Verify plugin loading
run: |
INSTALLER_DIR=$(cygpath -u '${{ steps.build.outputs.INSTALLER_DIR }}')/${{ steps.build.outputs.INSTALLER_NAME }}
Expand All @@ -81,6 +102,14 @@ jobs:
PATH=${INSTALLER_DIR}/bin ./verify_plugin_loads.exe "${x}"
done
- name: Verify passing tests match 2.5.0 release
run: |
wget https://github.com/NatronGitHub/Natron/releases/download/v2.5.0/Natron-2.5.0-Windows-x86_64-tests.txt
if diff Natron-2.5.0-Windows-x86_64-tests.txt ${{ steps.build.outputs.TEST_RESULTS_FILE }}; then
echo "Test results match 2.5.0 release : PASS"
else
echo "Test results match 2.5.0 release : FAILED"
fi
win-installer-breakpad:
name: Windows Installer (with Breakpad crash reporting)
Expand Down
10 changes: 5 additions & 5 deletions tools/jenkins/build-Windows-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ cp "$INC_PATH/config/"*.png "$INSTALLER_PATH/config/"

# make sure we have mt and qtifw

if ! which mt.exe; then
MT_BIN=mt.exe
if ! which ${MT_BIN}; then
# Add Windows SDK to path so that mt.exe is available.
WIN_SDK_MAJOR_VERSION=10
WIN_SDK_BASE_PATH="/c/Program Files (x86)/Windows Kits/${WIN_SDK_MAJOR_VERSION}/bin"
WIN_SDK_VERSION=$(ls "${WIN_SDK_BASE_PATH}" | grep "${WIN_SDK_MAJOR_VERSION}." | sort -n | tail -1)
PATH="${WIN_SDK_BASE_PATH}/${WIN_SDK_VERSION}/x64/":${PATH}
MT_BIN=$(find "${WIN_SDK_BASE_PATH}" -name mt.exe | grep x64 | sort -n | tail -1)

if ! which mt.exe; then
if [[ -z "${MT_BIN}" ]]; then
echo "Failed to find mt.exe"
exit 1
fi
Expand Down Expand Up @@ -222,7 +222,7 @@ function installPlugin() {
done
echo "</assembly>" >> "$PLUGIN_MANIFEST"
for location in "$PKG_PATH/data" "${TMP_PORTABLE_DIR}"; do
(cd "$location/Plugins/OFX/Natron/${OFX_BINARY}.ofx.bundle/Contents/Win${BITS}"; mt -nologo -manifest "$PLUGIN_MANIFEST" -outputresource:"${OFX_BINARY}.ofx;2")
(cd "$location/Plugins/OFX/Natron/${OFX_BINARY}.ofx.bundle/Contents/Win${BITS}"; "${MT_BIN}" -nologo -manifest "$PLUGIN_MANIFEST" -outputresource:"${OFX_BINARY}.ofx;2")
done

fi
Expand Down

0 comments on commit 7df36b4

Please sign in to comment.