-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: amannocci <[email protected]>
- Loading branch information
Showing
6 changed files
with
138 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,63 @@ | ||
--- | ||
|
||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
## Concurrency only allowed in the main branch. | ||
## So old builds running for old commits within the same Pull Request are cancelled | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
||
jobs: | ||
test: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: '.python-version' | ||
|
||
- name: Install poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
poetry install --no-interaction | ||
- name: Setup environment | ||
uses: ./.github/workflows/env-setup | ||
|
||
- name: Lint | ||
run: poetry run poe lint | ||
|
||
build: | ||
needs: | ||
- lint | ||
strategy: | ||
matrix: | ||
os: | ||
- macos-14 | ||
- macos-13 | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup environment | ||
uses: ./.github/workflows/env-setup | ||
|
||
- name: Build | ||
run: poetry run poe build | ||
|
||
test: | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup environment | ||
uses: ./.github/workflows/env-setup | ||
|
||
- name: Test | ||
run: poetry run poe test |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
name: env-setup | ||
description: Setup environment | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up QEMU | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: ".python-version" | ||
|
||
- name: Install poetry and dependencies | ||
run: | | ||
pip3 install --no-cache-dir --upgrade pip poetry | ||
poetry install --no-interaction | ||
shell: "bash" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.11.6 | ||
3.11.9 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
# Base image for build | ||
ARG base_image_version=3.10.12 | ||
FROM python:${base_image_version}-bullseye as builder | ||
FROM python:${base_image_version}-slim-bullseye as builder | ||
|
||
# Switch workdir | ||
WORKDIR /opt/temply | ||
|
||
# Arguments | ||
ARG platform_arch | ||
ARG app_version | ||
|
||
# Copy files | ||
COPY . . | ||
|
||
# Install build packages | ||
RUN \ | ||
apt-get update > /dev/null \ | ||
&& apt-get install -y --no-install-recommends \ | ||
binutils="*" \ | ||
&& apt-get clean | ||
|
||
# Install poetry | ||
ENV \ | ||
PATH="/opt/poetry/bin:${PATH}" \ | ||
POETRY_HOME=/opt/poetry \ | ||
POETRY_VIRTUALENVS_CREATE=false | ||
RUN \ | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
pip3 install --no-cache-dir --upgrade pip poetry | ||
|
||
# Build | ||
RUN \ | ||
poetry install \ | ||
&& poetry run pyinstaller temply.spec \ | ||
&& mv /opt/temply/dist/temply /opt/temply/dist/temply-${app_version}-${platform_arch} | ||
&& poetry run pyinstaller temply.spec |
This file contains 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
This file contains 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