Add SonarQube analysis on pull requests and releases #12
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-ui | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r ui/requirements.txt -r ui/requirements.conf | |
| - name: Build executable | |
| run: | | |
| if [[ "${{ matrix.os }}" == "windows-latest" ]]; then SEP=';'; else SEP=':'; fi | |
| cd ui | |
| python -m PyInstaller --name ok_computer_ui-${{ matrix.os }} --onedir --noconfirm --clean \ | |
| --noconsole \ | |
| --add-data "../.env.example${SEP}." \ | |
| --add-data "templates${SEP}templates" \ | |
| --add-data "static${SEP}static" \ | |
| --add-data "../src${SEP}src" \ | |
| --collect-submodules flask \ | |
| --hidden-import socket \ | |
| --hidden-import webview \ | |
| --hidden-import webview.platforms.cocoa \ | |
| --hidden-import webview.platforms.winforms \ | |
| app.py | |
| shell: bash | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ok_computer_ui-${{ matrix.os }} | |
| path: ui/dist/** |