Skip to content

Commit

Permalink
Update github action to use a poetry installer action again, making b…
Browse files Browse the repository at this point in the history
…uilds on windows easier.
  • Loading branch information
Ivorforce committed Jul 1, 2024
1 parent 50f94ef commit c3418c1
Showing 1 changed file with 22 additions and 36 deletions.
58 changes: 22 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ env:
POETRY_VERSION: "1.8.1"
POETRY_URL: https://install.python-poetry.org

defaults:
run:
shell: bash

jobs:
build:
strategy:
Expand All @@ -21,50 +25,32 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
id: setup_python

# Poetry cache depends on OS, Python version and Poetry version.
- name: Cache Poetry cache
uses: actions/cache@v3
- name: Install Poetry
uses: snok/install-poetry@v1
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
# virtualenv cache should depends on OS, Python version and `poetry.lock` (and optionally workflow files).
- name: Cache Packages
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-pip-wheels
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-local-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}
- name: Install Poetry ${{ env.POETRY_VERSION }}
run: |
curl -sSL ${{ env.POETRY_URL }} | python - --version ${{ env.POETRY_VERSION }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Dependencies
run: poetry install
path: ~/.cache
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction

- name: Build Executable
uses: Nuitka/Nuitka-Action@main
with:
nuitka-version: main
script-name: src/ecgviewer/main.py
onefile: true
include-package-data: |
dash
dash_core_components
dash_html_components
packaging
plotly
ecgviewer
include-package: |
dash
dash_core_components
dash_html_components
packaging
plotly
ecgviewer
run: |
source $VENV
python -m nuitka --onefile --include-package=dash --include-package-data=dash --include-package=dash_core_components --include-package-data=dash_core_components --include-package=dash_html_components --include-package-data=dash_html_components --include-package=packaging --include-package-data=packaging --include-package=plotly --include-package-data=plotly --include-package=ecgviewer --include-package-data=ecgviewer src/ecgviewer/main.py
- name: Upload Artifacts
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit c3418c1

Please sign in to comment.