install.bat: - Add conda self-test (conda --version) before env create - Verify botty python.exe exists after env creation - Smoke-test key imports (cv2, tesserocr, discord, etc.) CI (.github/workflows/ci.yml): - Add test_setup_bat_files.py to test matrix test/test_setup_bat_files.py (7 tests): - All expected .bat files exist - No hardcoded usernames (alex, alexpolo, ultimate) in run scripts - No absolute home paths in run scripts (must use %~dp0 / %USERNAME%) - All run_*.bat source find_python.bat (no duplicated conda detection) - find_python.bat checks >= 6 conda locations - install.bat has conda self-test and python verification
99 lines
2.9 KiB
YAML
99 lines
2.9 KiB
YAML
name: Botty - CI
|
|
on:
|
|
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.yml
|
|
use-only-tar-bz2: false
|
|
|
|
- name: Download test assets
|
|
shell: powershell
|
|
env:
|
|
PYTHONPATH: ./src
|
|
run: |
|
|
C:\Miniconda\condabin\conda.bat activate botty
|
|
python -c "import utils.download_test_assets"
|
|
|
|
- name: Pytest
|
|
shell: powershell
|
|
env:
|
|
PYTHONPATH: ./src
|
|
run: |
|
|
C:\Miniconda\condabin\conda.bat activate botty
|
|
python -c "import sys; print(sys.version)"
|
|
coverage run -m pytest test/smoke_test.py test/nip/ test/game_stats_test.py test/closest_non_hud_test.py test/transmute/ test/test_setup_bat_files.py -v -s
|
|
|
|
- name: Coverage
|
|
shell: powershell
|
|
env:
|
|
PYTHONPATH: ./src
|
|
run: |
|
|
C:\Miniconda\condabin\conda.bat activate botty
|
|
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.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: 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
|