Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit ca062ad

Browse files
committed
ci: 👷 try to improve speed
This caches the .venv, in addition to the entire `build` folder. Also fixes builds being compiled with Python 3.9 instead of the installed 3.10.
1 parent 256fef3 commit ca062ad

3 files changed

Lines changed: 198 additions & 245 deletions

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,13 @@ jobs:
102102
- name: Cache
103103
uses: actions/cache@v3
104104
with:
105-
path: build/gui.build
105+
path: build
106106
key: ci-build-source-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}
107+
- name: Cache venv
108+
uses: actions/cache@v3
109+
with:
110+
path: .venv
111+
key: ci-build-venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}
107112
- name: Get normalized branch name
108113
shell: bash
109114
run: |
@@ -112,9 +117,12 @@ jobs:
112117
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
113118
- name: Install dependencies and build
114119
run: |
115-
pipx run poetry install --no-interaction --with compile -E gui
120+
# required to use `python3` here as otherwise the venv is created with python 3.9
121+
python3 -m pip install pipx
122+
python3 -m pipx run poetry install --no-interaction --with compile -E gui
116123
./.venv/Scripts/activate.ps1
117-
pip install nuitka minecraft_launcher_lib PySide6 click tomli darkdetect
124+
# pip install nuitka minecraft_launcher_lib PySide6 click tomli darkdetect
125+
echo '__version__ = "${{ env.BRANCH }}+${{ steps.short-sha.outputs.sha }}"' | Out-File vanilla_installer/__init__.py
118126
pyside6-rcc vanilla_installer/assets/fonts.qrc -o vanilla_installer/fonts.py
119127
python -m nuitka --standalone --onefile --windows-icon-from-ico=media/icon.ico --output-dir=build --include-package=minecraft_launcher_lib,PySide6,click,tomli,darkdetect -o "Vanilla Installer-GUI ${{ env.BRANCH }}+${{ steps.short-sha.outputs.sha }}.exe" --enable-plugin=pyside6 --include-data-dir=vanilla_installer/assets=assets/ --disable-console --nofollow-import-to=PySide6.examples vanilla_installer/gui.py --assume-yes-for-downloads
120128
- name: Upload built executable
@@ -127,7 +135,10 @@ jobs:
127135
build-windows-cli:
128136
name: Build CLI for Windows
129137
runs-on: windows-2022
130-
needs: [lint, build-python, build-windows]
138+
needs: [lint, build-python]
139+
defaults:
140+
run:
141+
shell: pwsh
131142
steps:
132143
- uses: actions/checkout@v3
133144
- name: Set up Python 3.10
@@ -140,8 +151,13 @@ jobs:
140151
- name: Cache
141152
uses: actions/cache@v3
142153
with:
143-
path: build/cli.build
154+
path: build
144155
key: ci-build-source-cli-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}
156+
- name: Cache venv
157+
uses: actions/cache@v3
158+
with:
159+
path: .venv
160+
key: ci-build-venv-cli-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}
145161
- name: Get normalized branch name
146162
shell: bash
147163
run: |
@@ -150,60 +166,15 @@ jobs:
150166
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
151167
- name: Install dependencies and build
152168
run: |
153-
pipx run poetry install --no-interaction --with compile
169+
# required to use `python3` here as otherwise the venv is created with python 3.9
170+
python3 -m pip install pipx
171+
python3 -m pipx run poetry install --no-interaction --with compile
154172
./.venv/Scripts/activate.ps1
155-
pip install nuitka minecraft_launcher_lib click tomli darkdetect asyncclick
173+
# pip install nuitka minecraft_launcher_lib click tomli darkdetect asyncclick
156174
echo '__version__ = "${{ env.BRANCH }}+${{ steps.short-sha.outputs.sha }}"' | Out-File vanilla_installer/__init__.py
157175
python -m nuitka --standalone --onefile --windows-icon-from-ico=media/icon.ico --output-dir=build --include-package=minecraft_launcher_lib,asyncclick,click,tomli,darkdetect -o "vanilla-installer.exe" --enable-console --include-data-dir=vanilla_installer/assets=assets/ vanilla_installer/cli.py --assume-yes-for-downloads
158176
- name: Upload binaries
159177
uses: actions/upload-artifact@v3
160178
with:
161179
name: Vanilla Installer ${{ env.BRANCH }}+${{ steps.short-sha.outputs.sha }} (Windows CLI)
162180
path: build/*.exe
163-
164-
165-
# build-macos:
166-
# name: Build macOS app bundle
167-
# runs-on: macos-12
168-
# needs: [lint, build-python]
169-
# steps:
170-
# - uses: actions/checkout@v3
171-
# same as above
172-
# - name: Set up Python 3.10
173-
# uses: actions/setup-python@v4
174-
# with:
175-
# python-version: "3.10"
176-
# - name: Install and configure Poetry
177-
# uses: snok/install-poetry@v1
178-
# with:
179-
# virtualenvs-in-project: true
180-
# installer-parallel: true
181-
# - name: Load cached venv
182-
# id: cached-poetry-dependencies
183-
# uses: actions/cache@v3
184-
# with:
185-
# path: .venv
186-
# key: ci-build-macos-venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
187-
# - name: Shorten commit SHA
188-
# uses: benjlevesque/short-sha@v2.1
189-
# id: short-sha
190-
# was having issues without installing Qt, so install it using
191-
# this GHA wrapper around aqtinstall
192-
# - name: Install Qt
193-
# uses: jurplel/install-qt-action@v3
194-
# with:
195-
# version: 6.2.*
196-
# setup-python: false
197-
# aqtversion: ==3.1.*
198-
# py7zrversion: ==0.20.*
199-
# - name: Install dependencies
200-
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
201-
# run: poetry install --no-interaction --with compile
202-
203-
# - name: Build app bundle
204-
# run: poetry run python3 -m nuitka --macos-create-app-bundle --macos-app-icon=media/icon.icns --macos-app-version="dev+${{ steps.short-sha.outputs.sha }}" --macos-signed-app-name="io.github.fabulously_optimized.vanilla_installer" --standalone --onefile --output-dir=build --include-package=minecraft_launcher_lib,PySide6,click,tomli,darkdetect -o "Vanilla Installer-GUI v1.0.0b1.exe" --enable-plugin=pyside6 --include-data-dir=vanilla_installer/assets=assets/ --disable-console vanilla_installer/gui.py
205-
# - name: Upload built wheels
206-
# uses: actions/upload-artifact@v3
207-
# with:
208-
# name: Vanilla Installer $(date -u) (macOS)
209-
# path: "*.app"

0 commit comments

Comments
 (0)