Build and test #7080
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
| name: Build and test | |
| permissions: | |
| contents: read | |
| id-token: write | |
| attestations: write | |
| defaults: | |
| run: | |
| shell: bash | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'wiki/**' | |
| pull_request: | |
| schedule: | |
| - cron: '37 22 * * *' | |
| jobs: | |
| gha: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - macos-13 | |
| - macos-14 | |
| - macos-15 | |
| - macos-15-intel | |
| - ubuntu-22.04 | |
| - ubuntu-24.04 | |
| - ubuntu-24.04-arm | |
| - ubuntu-22.04-arm | |
| - windows-11-arm | |
| - windows-2025 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get npm cache directory | |
| id: npm-cache-dir | |
| run: | | |
| echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
| - uses: actions/cache@v4 | |
| id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | |
| with: | |
| path: ${{ steps.npm-cache-dir.outputs.dir }} | |
| key: ${{ matrix.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ matrix.os }}-node- | |
| - name: Windows Configure VCode | |
| uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # 1.13.0 | |
| if: runner.os == 'Windows' | |
| with: | |
| arch: ${{ runner.arch }} | |
| - name: Install WinAppDriver | |
| if: runner.os == 'Windows' | |
| run: | | |
| choco install -y winappdriver | |
| - name: Windows prep work | |
| if: runner.os == 'Windows' | |
| shell: cmd | |
| run : | | |
| reg add HKCU\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement /v ScoobeSystemSettingEnabled /t REG_DWORD /d 0 /f | |
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1" | |
| - name: Install NPM stuff | |
| if: runner.os == 'Windows' | |
| run: | | |
| echo "Installing appium..." | |
| npm install -g appium | |
| echo "Installing totp-generator..." | |
| npm install "totp-generator" | |
| echo "Installing wdio..." | |
| npm install @wdio/cli | |
| echo "Installing appium win driver..." | |
| appium driver install windows | |
| - name: Build our executable | |
| env: | |
| cid: ${{ job.container.id }} | |
| services: ${{ job.services }} | |
| stat: ${{ job.status }} | |
| run_num: ${{ github.run_number }} | |
| run_att: ${{ github.run_attempt }} | |
| run: | | |
| python3 -m venv venv | |
| if [[ "${RUNNER_OS}" == "Windows" ]]; then | |
| source venv/scripts/activate | |
| python=venv/scripts/python.exe | |
| pyinstaller=venv/scripts/pyinstaller.exe | |
| else | |
| python=venv/bin/python | |
| pyinstaller=venv/bin/pyinstaller | |
| fi | |
| echo "python=${python}" >> $GITHUB_ENV | |
| "$python" -m pip install --upgrade pyinstaller pyotp | |
| echo -e "import sys\nprint(f'Hello World, this is Python {sys.version}!')" > helloworld.py | |
| "$pyinstaller" --onefile helloworld.py | |
| file dist/helloworld* | |
| dist/helloworld | |
| - name: Install Certum MSI | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| #$url = "https://files.certum.eu/software/SimplySignDesktop/Windows/9.3.1.66/SimplySignDesktop-9.3.1.66-64-bit-pl.msi" | |
| #$file = "SimplySignDesktop-9.3.1.66-64-bit-pl.msi" | |
| $url = "https://files.certum.eu/software/SimplySignDesktop/Windows/9.3.2.67/SimplySignDesktop-9.3.2.67-64-bit-en.msi" | |
| $file = "SimplySignDesktop-9.3.2.67-64-bit-en.msi" | |
| Invoke-WebRequest $url -OutFile $file | |
| $log = "install.log" | |
| $procMain = Start-Process "msiexec" "/i `"$file`" /qn /l*! `"$log`"" -NoNewWindow -PassThru | |
| $procLog = Start-Process "powershell" "Get-Content -Path `"$log`" -Wait" -NoNewWindow -PassThru | |
| $procMain.WaitForExit() | |
| $procLog.Kill() | |
| - name: Generate OTP, login and sign | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| env: | |
| TOTP_SECRET: ${{ secrets.TOTP_SECRET }} | |
| run: | | |
| Set-NetFirewallProfile -Profile Private -Enabled False | |
| $appiumCmd = Get-Command appium | |
| $appiumPath = $appiumCmd.Path | |
| Start-Process -Filepath "powershell.exe" -ArgumentList "-File", $appiumPath, "--address", "127.0.0.1", "--log-level", "error" | |
| Start-Sleep -Seconds 10 | |
| write-host "appium started" | |
| write-host "running ssd" | |
| node ssd.mjs --log-level warn | |
| write-host "sleeping during login..." | |
| Start-Sleep 10 | |
| Start-Process -Wait -NoNewWindow -ErrorAction Continue -FilePath 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\signtool.exe' -ArgumentList "sign", "/sha1", "590dc5bb10dfb31dbff38c0e2f9c35ef0f6d0e9e", "/tr", "http://time.certum.pl", "/td", "SHA256", "/fd", "SHA256", "/v", "dist/helloworld.exe" | |
| write-Host "Verifying signature...." | |
| & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\signtool.exe' verify /pa dist/helloworld.exe | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2 | |
| with: | |
| name: helloworld-${{ matrix.os }} | |
| if-no-files-found: ignore | |
| path: | | |
| *.png | |