Skip to content

Add support for PWM servo mode and PWM capture mode. #661

Add support for PWM servo mode and PWM capture mode.

Add support for PWM servo mode and PWM capture mode. #661

Workflow file for this run

name: GHA CI
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
trik-version: ['', 'trik_new_age']
libs:
- qt-version: '5.12'
mingw-version: '7.3'
mingw-short-version: 73
python-version: '3.9'
- qt-version: '5.15'
mingw-version: '8.1'
mingw-short-version: 81
python-version: '3.12'
defaults:
run:
shell: pwsh #to prevent unexpected Git Bash with wrong MSys DLLs
steps:
- name: Configure git
shell: bash
run: |
git config --global core.symlinks true
git config --global core.autocrlf true
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 1
- name: 'Disable Windows Just-in-Time Debugger/Error reporting'
shell: pwsh
run: |
# reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" /v Debugger /d - /t REG_SZ /f
# reg add "HKLM\SOFTWARE\Microsoft\.NETFramework" /v DbgManagedDebugger /d - /t REG_SZ /f
# reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v DontShowUI /d 1 /t REG_DWORD /f
# reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v ForceQueue /d 1 /t REG_DWORD /f
# reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent" /v DefaultConsent /d 1 /t REG_DWORD /f
# reg add "HKLM\System\CurrentControlSet\Control\Windows" /v ErrorMode /d 2 /t REG_DWORD /f
#
#
# reg add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" /v Debugger /d - /t REG_SZ /f
# reg add "HKCU\SOFTWARE\Microsoft\.NETFramework" /v DbgManagedDebugger /d - /t REG_SZ /f
# reg add "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v DontShowUI /d 1 /t REG_DWORD /f
# reg add "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v ForceQueue /d 1 /t REG_DWORD /f
# reg add "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent" /v DefaultConsent /d 1 /t REG_DWORD /f
#
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
release: true
update: false
msystem: MINGW32
path-type: inherit #strict #inherit #minimal
install: >-
base
rsync
git
- name: Purge MinGW conflicting packages
run: 'pacman --remove --noconfirm --cascade --recursive --unneeded gcc python3 || :'
shell: msys2 {0}
- name: Install Qt ${{ matrix.libs.qt-version }}
uses: jurplel/install-qt-action@v4
with:
version: ${{matrix.libs.qt-version}}
arch: win32_mingw${{matrix.libs.mingw-short-version}}
modules: 'qtscript'
archives: 'qtbase qtsvg qtserialport qtmultimedia qtwinextras qtimageformats i686 qttools qtdeclarative qtquickcontrols2'
tools: 'tools_mingw,qt.tools.win32_mingw${{matrix.libs.mingw-short-version}}0'
extra: '--external 7z'
# After Qt install action, that spoils pythonLocation variable
- name: Set up Python ${{ matrix.libs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.libs.python-version }}
architecture: 'x86'
- name: Update PATH
shell: msys2 {0}
run: |
set -xue
cygpath -w /usr/bin >> $GITHUB_PATH
cygpath -w /mingw32/bin >> $GITHUB_PATH
cygpath -w "${IQTA_TOOLS}/mingw${{matrix.libs.mingw-short-version}}0_32/bin" >> $GITHUB_PATH
cygpath -w "${pythonLocation}/bin" >> $GITHUB_PATH
cygpath -w "${QT_ROOT_DIR}/bin" >> $GITHUB_PATH
- name: Check PATH
shell: msys2 {0}
run: |
echo "Check for DLL-Hell"
where '$PATH:cygwin1.dll' '$PATH:libatomic-1.dll' '$PATH:libgcc_s_dw2-1.dll' '$PATH:libstdc++-6.dll' '$PATH:libwinpthread-1.dll' || :
echo '----'
echo "$GITHUB_PATH"
cat "$GITHUB_PATH"
echo '----'
echo PATH="$PATH"
- name: Check available tools
shell: msys2 {0}
run: |
set -xueo pipefail
uname -a
which rsync && rsync --version
which python3 && python3 --version
which g++ && g++ --version
ls "$IQTA_TOOLS/" "$QT_ROOT_DIR/"
which qmake && qmake --version
- name: QMake
shell: msys2 {0}
run: |
export PYTHON_VERSION=$(python3 --version | grep -o '3\.[^.]\+')
qmake trikRuntime.pro -spec win32-g++ CONFIG+=trik_not_brick CONFIG+=tests CONFIG+=release \
PYTHON_PATH="${pythonLocation}" PYTHON_VERSION=${PYTHON_VERSION} \
CONFIG+=force_debug_info CONFIG+="${{ matrix.trik-version }}"
- name: QMake all
shell: msys2 {0}
timeout-minutes: 5
run: mingw32-make -j $(nproc) qmake_all
- name: Make all
shell: msys2 {0}
timeout-minutes: 10
run: mingw32-make -j $(nproc) all
- name: Tests
id: tests
shell: msys2 {0}
timeout-minutes: 3
continue-on-error: true
run: |
echo "$PATH"
echo ------
export TRIK_PYTHONPATH=$(cygpath -w "$pythonLocation/Lib")
export PYTHONDEVMODE=1
mingw32-make check -k
- name: Prepare for RDP connection
if: false
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
- name: Check errors
if: ${{ steps.tests.outcome == 'failure' }}
run: |
echo Errors occurred in the step Tests
exit 1