Check installation location. #155
This file contains hidden or 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
# Test the build on Windows; does not create any assets. | |
name: Windows 11 | |
on: [push] | |
defaults: | |
run: | |
shell: msys2 {0} | |
jobs: | |
msys2-ucrt64: | |
runs-on: windows-latest | |
name: Windows 11 | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: UCRT64 | |
update: true | |
install: >- | |
curl | |
git | |
mingw-w64-ucrt-x86_64-gcc | |
mingw-w64-ucrt-x86_64-python | |
mingw-w64-ucrt-x86_64-gtkmm3 | |
mingw-w64-ucrt-x86_64-boost | |
mingw-w64-ucrt-x86_64-sqlite3 | |
mingw-w64-ucrt-x86_64-cmake | |
mingw-w64-ucrt-x86_64-python-matplotlib | |
mingw-w64-ucrt-x86_64-python-sympy | |
mingw-w64-ucrt-x86_64-github-cli | |
- name: Authenticate GitHub CLI | |
run: gh auth setup-git | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@master | |
name: Checkout source | |
- name: Build | |
run: | | |
mkdir build | |
cd build | |
# Turn off searching Python in the registry, as that contains the | |
# windows Python which is not the MSYS python that we want to use. | |
cmake -DPython_FIND_REGISTRY=NEVER .. | |
ninja | |
ninja install | |
cpack | |
- name: Set version variables from output of cmake | |
run: | | |
VER=$(cat build/VERSION) | |
echo "VERSION=$VER" >> $GITHUB_ENV | |
- name: Upload installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cadabra2-win64.exe | |
path: build/cadabra2-${{ env.VERSION }}-win64.exe | |
retention-days: 2 | |
test: | |
needs: msys2-ucrt64 | |
runs-on: windows-latest | |
steps: | |
- name: Download installer | |
uses: actions/download-artifact@v4 | |
with: | |
name: cadabra2-win64.exe | |
- name: Install silently | |
shell: pwsh | |
run: | | |
dir | |
$installer = Get-ChildItem -Filter "cadabra*.exe" | Select-Object -First 1 -ExpandProperty Name | |
if (-not $installer) { | |
Write-Error "No installer found" | |
exit 1 | |
} | |
Write-Host "Installing $installer" | |
Start-Process -FilePath ".\$installer" -ArgumentList "/S" -Wait | |
Write-Host "Installer finished" | |
- name: Check installation location | |
shell: cmd | |
run: | | |
echo "Program Files content:" | |
dir "C:\Program Files\Cadabra2" /s | |
echo "Program Files (x86) content:" | |
dir "C:\Program Files (x86)\Cadabra2" /s | |
echo "User install location:" | |
dir "C:\Users\runneradmin\AppData\Local\Programs\Cadabra2" /s | |
- name: Test GUI startup | |
shell: cmd | |
run: | | |
start "Cadabra2" "C:\Program Files\Cadabra2\bin\cadabra2-gtk.exe" | |
timeout /t 30 | |
tasklist /FI "IMAGENAME eq cadabra2-gtk.exe" | find "cadabra2-gtk.exe" > nul | |
if errorlevel 1 ( | |
echo GUI failed to start | |
exit /b 1 | |
) | |
taskkill /F /IM cadabra2-gtk.exe |