Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/monthly_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
schedule:
- cron: '0 0 1 * *' # Runs at midnight UTC on the 1st of every month

run-name: "Monthly Package Test"

jobs:
package_and_test:
uses: ./.github/workflows/reusable_package.yml
strategy:
fail-fast: false
matrix:
python_version: ["3.10","3.11","3.12","3.13"]
python_version: ["3.10","3.11","3.12","3.13","3.14"]
with:
python_version: "${{ matrix.python_version }}"
run_tests: "true"
run_tests: "true"
15 changes: 11 additions & 4 deletions .github/workflows/package_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ on:
python_version:
type: choice
description: "Python version to run package test on"
default: "3.13"
default: "3.14"
options:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
run_tests:
type: boolean
description: "Run tests"
Expand All @@ -25,8 +26,11 @@ on:
description: "Run all tests"
default: false

run-name: "Package and Test Workflow"

jobs:
manual_test:
name: Run Manual Package Test
if: github.event_name == 'workflow_dispatch' && github.event.inputs.run_all == 'false'
uses: ./.github/workflows/reusable_package.yml
with:
Expand All @@ -35,29 +39,32 @@ jobs:


manual_test_all:
name: Run Manual Package Test on All Python Versions
if: github.event_name == 'workflow_dispatch' && github.event.inputs.run_all == 'true'
uses: ./.github/workflows/reusable_package.yml
strategy:
fail-fast: false
matrix:
python_version: ["3.10","3.11","3.12","3.13"]
python_version: ["3.10","3.11","3.12","3.13","3.14"]
with:
python_version: "${{ matrix.python_version }}"
run_tests: "${{ github.event.inputs.run_tests }}"

pull_request:
name: Run Package Test on Pull Request
if: github.event_name == 'pull_request'
uses: ./.github/workflows/reusable_package.yml
strategy:
matrix:
python_version: ["3.10","3.11","3.12","3.13"]
python_version: ["3.10","3.11","3.12","3.13","3.14"]
with:
python_version: "${{ matrix.python_version }}"
run_tests: "true"

release:
name: Run Package Test on Release Tag
if: github.ref_type == 'tag'
uses: ./.github/workflows/reusable_package.yml
with:
python_version: ${{ github.event.inputs.python_version }}
run_tests: "true"
run_tests: "true"
14 changes: 10 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ name: Release Package
on:
workflow_dispatch:

run-name: "Release pyomnidata Package"

jobs:
get_version:
name: Get Package Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
Expand All @@ -22,6 +25,7 @@ jobs:
echo "::set-output name=version::$version"

tag:
name: Create Git Tag
runs-on: ubuntu-latest
needs: get_version
steps:
Expand Down Expand Up @@ -55,17 +59,19 @@ jobs:

tests:
# Use your reusable workflow for manual_test_all
name: Run Tests on All Python Versions
needs: tag
uses: ./.github/workflows/reusable_package.yml
strategy:
matrix:
python_version: ["3.10", "3.11", "3.12", "3.13"]
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
with:
run_tests: "true"
python_version: ${{ matrix.python_version }}

build:
needs: [tests, get_version]
name: Build and Release Package
needs: [tag, tests, get_version]
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
Expand All @@ -80,12 +86,12 @@ jobs:
- name: Build Docker Image
run: |
# Use a default python version for the Docker target – adjust if needed.
pyver="3.13"
pyver="3.14"
pyref="py${pyver//./}"
docker_image="pyomnidata:${pyref}"
echo "Docker image: ${docker_image}"
echo "docker_image=${docker_image}" >> $GITHUB_ENV
docker build --target $pyref -t $docker_image .
docker build --build-arg PYTHON_VERSION=3.14 -t $docker_image .

- name: Run Docker Container
run: |
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/reusable_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ on:
type: string
description: "Run tests"
default: "true"

env:
PYTHON_VERSION: ${{ inputs.python_version }}

jobs:
package_and_test:
name: "Package and Test pyomnidata with Python ${{ inputs.python_version }}"
runs-on: "ubuntu-latest"
steps:
- name: Checkout current branch
Expand All @@ -26,12 +31,12 @@ jobs:

- name: Build Docker Image
run: |
pyver="${{ inputs.python_version }}"
pyver="$PYTHON_VERSION"
pyref="py${pyver//./}"
docker_image="pyomnidata:${pyref}"
echo "Docker image: ${docker_image}"
echo "docker_image=${docker_image}" >> $GITHUB_ENV
docker build --target $pyref -t $docker_image .
docker build --build-arg PYTHON_VERSION=$PYTHON_VERSION -t $docker_image .

- name: Run Docker Image
run: |
Expand Down
71 changes: 7 additions & 64 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#######################################
# Base image and common dependencies #
#######################################
FROM ubuntu:24.04 AS base
FROM ubuntu:24.04
ARG PYTHON_VERSION=3.14

# Install common packages and add deadsnakes PPA for multiple Python versions
RUN apt-get update && \
apt-get install -y --no-install-recommends software-properties-common && \
Expand All @@ -20,76 +22,17 @@ RUN adduser omni
COPY . /pyomnidata
RUN chown omni:omni -R /pyomnidata

#######################################
# Stage for Python 3.10 #
#######################################
FROM base AS py310
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3.10 \
python3.10-venv \
python3.10-dev && \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-venv \
python${PYTHON_VERSION}-dev && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN chown omni: -R /app
USER omni
# Create a virtual environment, upgrade pip and install your package (editable mode)
RUN cd /app && python3.10 -m venv venv && \
RUN cd /app && python${PYTHON_VERSION} -m venv venv && \
./venv/bin/pip install --upgrade pip && \
./venv/bin/pip install setuptools wheel
CMD ["tail", "-f", "/dev/null"]
#######################################
# Stage for Python 3.11 #
#######################################
FROM base AS py311
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3.11 \
python3.11-venv \
python3.11-dev && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN chown omni: -R /app
USER omni
# Create a virtual environment, upgrade pip and install your package (editable mode)
RUN cd /app && python3.11 -m venv venv && \
./venv/bin/pip install --upgrade pip && \
./venv/bin/pip install setuptools wheel
CMD ["tail", "-f", "/dev/null"]
#######################################
# Stage for Python 3.12 #
#######################################
FROM base AS py312
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3.12 \
python3.12-venv \
python3.12-dev && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN chown omni: -R /app
USER omni
# Create a virtual environment, upgrade pip and install your package (editable mode)
RUN cd /app && python3.12 -m venv venv && \
./venv/bin/pip install --upgrade pip && \
./venv/bin/pip install setuptools wheel
CMD ["tail", "-f", "/dev/null"]
#######################################
# Stage for Python 3.13 #
#######################################
FROM base AS py313
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3.13 \
python3.13-venv \
python3.13-dev && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN chown omni: -R /app
USER omni
# Create a virtual environment, upgrade pip and install your package (editable mode)
RUN cd /app && python3.13 -m venv venv && \
./venv/bin/pip install --upgrade pip && \
./venv/bin/pip install setuptools wheel
CMD ["tail", "-f", "/dev/null"]