name: CI on: push: branches: [main, develop] pull_request: branches: [main] jobs: test: runs-on: windows-latest strategy: matrix: python-version: ['3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Cache pip uses: actions/cache@v4 with: path: ~\AppData\Local\pip\Cache key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install pytest pytest-cov - name: Run integration tests run: python _integration_test.py - name: Run i18n GUI tests (offscreen) env: QT_QPA_PLATFORM: offscreen run: python _i18n_gui_test.py - name: Run pytest (if tests/ exists) env: QT_QPA_PLATFORM: offscreen run: | if (Test-Path tests) { pytest tests --cov=core --cov=utils } build: needs: test runs-on: windows-latest if: github.event_name == 'push' && github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.10' - name: Install dependencies + PyInstaller run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install pyinstaller - name: Build exe run: python -m PyInstaller --clean main.spec - name: Upload artifact uses: actions/upload-artifact@v4 with: name: ClockOutCalculator-exe path: dist/main.exe retention-days: 14