|
| 1 | +name: Build CUDA executable |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build: |
| 8 | + |
| 9 | + runs-on: ${{ matrix.os }} |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + python-version: ['3.10'] |
| 14 | + os: [windows-latest] |
| 15 | + env: |
| 16 | + # Display must be available globally for linux to know where xvfb is |
| 17 | + DISPLAY: ":99.0" |
| 18 | + QT_SELECT: "qt6" |
| 19 | + timeout-minutes: 30 |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@main |
| 23 | + with: |
| 24 | + fetch-depth: 0 |
| 25 | + - name: Set up Python ${{ matrix.python-version }} |
| 26 | + uses: actions/setup-python@main |
| 27 | + with: |
| 28 | + python-version: ${{ matrix.python-version }} |
| 29 | + - name: Setup xvfb (Linux) |
| 30 | + if: runner.os == 'Linux' |
| 31 | + run: | |
| 32 | + # Stuff copied wildly from several stackoverflow posts |
| 33 | + sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 libxcb-shape0 libglib2.0-0 libgl1-mesa-dev |
| 34 | + sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev |
| 35 | + # start xvfb in the background |
| 36 | + sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 & |
| 37 | + - name: Install Python dependencies |
| 38 | + run: | |
| 39 | + # prerequisites |
| 40 | + python -m pip install --upgrade pip wheel |
| 41 | + python -m pip install coverage flake8 pytest |
| 42 | + - name: Install extended dependencies |
| 43 | + run: | |
| 44 | + pip install .[cli,gui,torch] |
| 45 | + pip install -r tests/requirements-full.txt |
| 46 | + pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 |
| 47 | + - name: Build windows executable |
| 48 | + if: runner.os == 'windows' |
| 49 | + working-directory: ./build-recipes |
| 50 | + run: | |
| 51 | + pip install -r win_build_requirements.txt |
| 52 | + pyinstaller -y --log-level=WARN win_ChipStream.spec |
| 53 | + dir |
| 54 | + dir dist |
| 55 | + dir dist\\ChipStream |
| 56 | + # Run the binary (the most simple test) |
| 57 | + dist\\ChipStream\\ChipStream.exe --version |
| 58 | + python win_make_iss.py |
| 59 | + ISCC.exe /Q win_chipstream.iss |
| 60 | + - name: Upload windows executables |
| 61 | + id: uploadBinaryArtifact |
| 62 | + uses: actions/upload-artifact@v4.4.3 |
| 63 | + with: |
| 64 | + name: cuda-executables |
| 65 | + path: ./build-recipes/Output/*.exe |
0 commit comments