Add verbose flag for rsync and step timeout #367
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Windows build | |
on: | |
push: | |
branches-ignore: | |
- 'dependabot**' | |
tags: | |
- '*' | |
paths-ignore: | |
- '**/lsan.supp' | |
- 'buildScripts/travis/*' | |
- 'buildScripts/azure/*' | |
- 'buildScripts/docker/*' | |
- 'azure-pipelines.yml' | |
- '.cirrus.yml' | |
- '.travis.yml' | |
- '.mergify.yml' | |
- 'Brewfile' | |
- '**/*.html' | |
- '**/*.txt' | |
- '**/*.md' | |
- 'installer/packages/**/meta/prebuild-mac.sh' | |
- 'installer/packages/**/meta/prebuild-linux-gnu.sh' | |
- '**/*.dockerfile' | |
- '**/*.Dockerfile' | |
- '**/Dockerfile' | |
- '**/Dockerfile.*' | |
- 'plugins/robots/checker/scripts/build-checker-installer.sh' | |
- '.github/workflows/centos.yml' | |
pull_request: | |
branches-ignore: | |
- 'dependabot**' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- qt-version: '5.15' | |
mingw-version: '8.1' | |
mingw-bitness: '64' | |
mingw-short-version: '81' | |
python-version: '3.11' | |
deploy-installer: true | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: Setup msys2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
path-type: inherit | |
msystem: MINGW${{ matrix.mingw-bitness }} | |
- name: Download packages to msys2 | |
run: | | |
ARCH=${{ matrix.mingw-bitness }} | |
PLATFORM=${{ matrix.mingw-bitness == '32' && 'i686' || 'x86_64' }} | |
pacman --verbose --noconfirm -S msys/zlib-devel dos2unix ccache rsync unzip openssh mingw$ARCH/mingw-w64-$PLATFORM-libzip mingw$ARCH/mingw-w64-$PLATFORM-libusb mingw$ARCH/mingw-w64-$PLATFORM-zlib mingw$ARCH/mingw-w64-$PLATFORM-pkg-config | |
- name: Inject slug/short variables | |
uses: rlespinasse/[email protected] | |
- name: Prepare build directory name | |
shell: bash | |
run: | | |
DIR=$(realpath $(cygpath -u "$GITHUB_WORKSPACE")/../build) | |
echo "BUILD_DIR=$DIR" >> $GITHUB_ENV | |
- name: Create build directory | |
run: mkdir -vp ${{ env.BUILD_DIR }} | |
- name: Configure git | |
shell: bash | |
run: | | |
git config --global core.symlinks true | |
git config --global core.autocrlf true | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
dir: C:\ | |
version: '${{matrix.qt-version}}' | |
arch: win${{ matrix.mingw-bitness }}_mingw${{matrix.mingw-short-version}} | |
modules: 'qtscript' | |
archives: 'qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats qtwinextras' | |
tools: 'tools_mingw,qt.tools.win${{ matrix.mingw-bitness }}_mingw${{matrix.mingw-short-version}}0 tools_ifw' | |
add-tools-to-path: true | |
cache: true | |
extra: '--external 7z' | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
# After Qt install action, that spoils pythonLocation variable | |
- name: Set up Python ${{matrix.python-version}} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{matrix.python-version}} | |
architecture: ${{ matrix.mingw-bitness == '32' && 'x86' || 'x64' }} | |
- name: Check PATH | |
run: echo PATH="$PATH" | |
- name: Check available tools | |
run: | | |
set -xueo pipefail | |
uname -a | |
rsync --version | |
ls "$IQTA_TOOLS/" "$QT_ROOT_DIR/" | |
qmake --version && qmake -query | |
python3 --version | |
which g++ | |
g++ --version | |
- name: QMake | |
timeout-minutes: 1 | |
run: | | |
cd ${{ env.BUILD_DIR }} | |
qmake $GITHUB_WORKSPACE/studio.pro -spec win32-g++ CONFIG+=release CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=tests CONFIG+=noPch PYTHON_PATH="${pythonLocation}" PYTHON_VERSION=${{matrix.python-version}} | |
- name: QMake all | |
timeout-minutes: 5 | |
run: | | |
cd ${{ env.BUILD_DIR }} | |
mingw32-make -j $(nproc) qmake_all | |
- name: Make all | |
timeout-minutes: 70 | |
run: | | |
cd ${{ env.BUILD_DIR }} | |
mingw32-make -j $(nproc) all | |
- name: Unit tests | |
timeout-minutes: 5 | |
run: | | |
cd ${{ env.BUILD_DIR }} | |
export TRIK_PYTHONPATH=$(cygpath -w "${pythonLocation}/Lib") | |
mingw32-make -k check | |
- name: Prepare all dlls | |
if: false | |
run: | | |
for file in $(ls ${{ env.BUILD_DIR }}/bin/*.exe || :) ; do windeployqt --release $file ; done | |
- name: Download tests | |
run: | | |
curl --output tests.7z "https://dl.trikset.com/edu/.solutions20200701/testing_small.7z" | |
7z x tests.7z | |
ls $GITHUB_WORKSPACE/testing_small | |
- name: Tests | |
id: tests | |
timeout-minutes: 2 | |
continue-on-error: true | |
run: | | |
echo "$PATH" | |
echo ------ | |
cd ${{ env.BUILD_DIR }}/bin | |
python "${{ github.workspace }}\buildScripts\tests\fieldstest.py" 2D-model.exe "${{ github.workspace }}\testing_small" | |
- name: Push binaries | |
if: false | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binaries-${{ matrix.qt-version}} | |
path: ${{ env.BUILD_DIR }}/bin | |
- name: Build installer | |
run: | | |
cd $GITHUB_WORKSPACE/installer | |
./build-trik-studio.sh "${QT_ROOT_DIR}/bin" "${IQTA_TOOLS}/QtInstallerFramework/*/bin" "${{ env.BUILD_DIR }}" | |
- name: Push installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: trik-studio-auto-installer-qt${{ matrix.qt-version}} | |
path: | | |
installer/trik-studio*installer*.exe | |
installer/trik_studio*.qs | |
installer/reinstall* | |
- name: Check errors | |
if: ${{ steps.tests.outcome == 'failure' }} | |
run: | | |
echo Errors occurred in the step Tests | |
exit 1 | |
- name: Get tag | |
run: echo "CURRENT_TAG=$(git tag --contains HEAD | sort -Vr | head -n1)" >> $GITHUB_ENV | |
- name: Check tag | |
if: ${{ env.CURRENT_TAG != ''}} | |
run: echo "GITHUB_REF_SLUG=${{ env.CURRENT_TAG }}" >> $GITHUB_ENV | |
- name: Deploy installer | |
if: ${{ matrix.deploy-installer && github.event_name != 'pull_request' && github.repository_owner == 'trikset' }} | |
run: | | |
install -m 600 -D /dev/null ~/.ssh/id_rsa | |
echo "${{ secrets.DL_PRIVATE_SSH_KEY }}" > ~/.ssh/id_rsa | |
rsync -v --rsh="ssh -o StrictHostKeyChecking=no" installer/trik-studio*installer*.exe ${{ secrets.DL_USERNAME }}@${{ secrets.DL_HOST }}:~/dl/ts/fresh/installer/trik-studio-${{ env.GITHUB_REF_SLUG }}-x86_64-installer.exe | |
- name: Prepare for RDP connection | |
if: false #comment this line to create RDP session | |
continue-on-error: true | |
shell: pwsh | |
env: | |
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} | |
run: | | |
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0 | |
Enable-NetFirewallRule -DisplayGroup "Remote Desktop" | |
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1 | |
Set-LocalUser -Name "runneradmin" -Password (ConvertTo-SecureString -AsPlainText "P@ssw0rd!" -Force) | |
Invoke-WebRequest https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-windows-amd64.zip -OutFile ngrok.zip | |
Expand-Archive ngrok.zip | |
.\ngrok\ngrok.exe authtoken $Env:NGROK_AUTH_TOKEN | |
choco install far dependencies | |
.\ngrok\ngrok.exe tcp 3389 | |
install-windows-installer: | |
needs: [build] | |
uses: ./.github/workflows/installer.yml | |
with: | |
os: windows-latest | |
artifact_name: trik-studio-auto-installer-qt5.15 | |
shell: msys2 {0} | |
deploy_archive: true | |
secrets: inherit |