Skip to content

feat: provide settings with default values #71

feat: provide settings with default values

feat: provide settings with default values #71

Workflow file for this run

# This workflow builds the package, installs it, and tests basic functionality
name: Build and Test Package
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test-build-package:
name: Test package build
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'bump:')"
steps:
- name: Check out the repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install uv
uses: astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f # v6.4.1
- name: Build the package
run: uv build
- name: List built artifacts
run: ls -la dist/
- name: Install the built wheel
run: |
uv venv
# Find the wheel file and install it
WHEEL_FILE=$(ls dist/*.whl | head -1)
echo "Installing wheel: $WHEEL_FILE"
uv pip install "$WHEEL_FILE"
- name: Test --version flag
run: |
# Test that the CLI is available and --version works
uv run lightman-ai --version
should-test-docker-build:
permissions:
contents: read
pull-requests: read
name: Check if should `test_docker_build` run
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'bump:')"
steps:
- name: Check out the repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check if Dockerfile changed
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: dockerfile-changes
with:
filters: |
dockerfile:
- 'Dockerfile'
- '.dockerignore'
outputs:
docker: ${{ steps.dockerfile-changes.outputs.dockerfile }}
test-docker-build:
needs: [should-test-docker-build]
name: Test Docker build
runs-on: ubuntu-latest
if: needs.should-test-docker-build.outputs.docker == 'true' && !startsWith(github.event.head_commit.message, 'bump:')
permissions:
contents: read
packages: read
steps:
- name: Check out the repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Log in to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: elementsinteractive/lightman-ai
- name: Build Docker image
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
images: docker.io/elementsinteractive/lightman-ai
context: .
file: ./Dockerfile
push: false
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/elementsinteractive/lightman-ai:buildcache