name: Botty - CI on: workflow_dispatch: pull_request: push: branches: [main, mine] release: types: [published] jobs: test: runs-on: windows-latest steps: - uses: actions/checkout@v4 - name: Setup Miniconda Python 3.10 uses: conda-incubator/setup-miniconda@v3 with: python-version: '3.10' activate-environment: botty channel-priority: strict environment-file: environment-win11.yml use-only-tar-bz2: false - name: Validate Botty shell: powershell env: PYTHONPATH: ./src RUN_ENV: test run: | $ErrorActionPreference = "Stop" C:\Miniconda\condabin\conda.bat activate botty python -c "import sys; print(sys.version)" python -m compileall -q src tools test coverage run -m pytest coverage xml build: needs: test runs-on: windows-latest steps: - uses: actions/checkout@v4 - name: Setup Miniconda Python 3.10 uses: conda-incubator/setup-miniconda@v3 with: python-version: '3.10' activate-environment: botty channel-priority: strict environment-file: environment-win11.yml use-only-tar-bz2: false - name: Build exe shell: powershell env: BOTTY_NO_RENAME: '1' PYTHONPATH: ./src run: | C:\Miniconda\condabin\conda.bat activate botty python build.py --conda_path C:\Miniconda - name: Launch smoke test (built executables) shell: powershell run: | $ErrorActionPreference = "Stop" $BOTTY_DIR = Get-ChildItem -Directory -Name | Where-Object { $_ -match '^botty_v' } | Select-Object -First 1 if (-not $BOTTY_DIR) { throw "No botty_v* build directory found." } $mainExe = Join-Path $BOTTY_DIR "main.exe" $shopperExe = Join-Path $BOTTY_DIR "shopper.exe" if (-not (Test-Path $mainExe)) { throw "Missing $mainExe" } if (-not (Test-Path $shopperExe)) { throw "Missing $shopperExe" } $procs = @() try { $mainProc = Start-Process -FilePath $mainExe -PassThru -WindowStyle Hidden Start-Sleep -Seconds 6 if ($mainProc.HasExited) { throw "main.exe exited early with code $($mainProc.ExitCode)" } $procs += $mainProc $shopperProc = Start-Process -FilePath $shopperExe -PassThru -WindowStyle Hidden Start-Sleep -Seconds 6 if ($shopperProc.HasExited) { throw "shopper.exe exited early with code $($shopperProc.ExitCode)" } $procs += $shopperProc } finally { foreach ($p in $procs) { if ($p -and -not $p.HasExited) { Stop-Process -Id $p.Id -Force } } } - name: Prepare release zip shell: powershell run: | $BOTTY_DIR = Get-ChildItem -Directory -Name | Where-Object { $_ -match '^botty_v' } | Select-Object -First 1 Write-Host "Botty dir: $BOTTY_DIR" Get-ChildItem -Path $BOTTY_DIR -Recurse | Select-Object -Property FullName, Length $ZIP = "${BOTTY_DIR}.zip" Compress-Archive -Path "${BOTTY_DIR}\*" -DestinationPath $ZIP -Force Write-Host "Release zip: $ZIP" Get-Item $ZIP | Select-Object -Property FullName, Length - name: Upload build artifacts uses: actions/upload-artifact@v4 with: name: botty-build path: botty_v*/ retention-days: 7 - name: Upload to Release if: github.event_name == 'release' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash run: | BOTTY_DIR=$(ls -d botty_v* | head -1) gh release upload "${{ github.event.release.tag_name }}" "${BOTTY_DIR}.zip" --clobber