From e344df4cfbc3310400dfd313cc9adcff186f70de Mon Sep 17 00:00:00 2001 From: Olivia Banks Date: Mon, 23 Mar 2026 23:04:24 -0600 Subject: [PATCH 1/2] [gha] try --- .github/workflows/containerfile.yml | 56 +++++++++++++++++++++++++++++ .github/workflows/copilot.yml | 32 +++++++++++++++++ .github/workflows/on_pr.yml | 28 +++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 .github/workflows/containerfile.yml create mode 100644 .github/workflows/copilot.yml create mode 100644 .github/workflows/on_pr.yml diff --git a/.github/workflows/containerfile.yml b/.github/workflows/containerfile.yml new file mode 100644 index 0000000..3be4e03 --- /dev/null +++ b/.github/workflows/containerfile.yml @@ -0,0 +1,56 @@ +name: Build and Push Container Image + +on: + push: + branches: + - main + paths: + - 'Containerfile' + - 'pyproject.toml' + - 'uv.lock' + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=sha,prefix= + + - name: Build and push container image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Containerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/copilot.yml b/.github/workflows/copilot.yml new file mode 100644 index 0000000..2b9b0b8 --- /dev/null +++ b/.github/workflows/copilot.yml @@ -0,0 +1,32 @@ +name: GitHub Copilot Dev Environment + +on: + workflow_dispatch: + +jobs: + copilot: + runs-on: ubuntu-latest + container: + image: ghcr.io/${{ github.repository }}:latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + version: "0.5.9" + + - name: Sync dependencies + run: uv sync --frozen + + - name: Setup Copilot environment + run: | + echo "Development environment ready for GitHub Copilot" + echo "Python version: $(python --version)" + echo "uv version: $(uv --version)" + uv pip list diff --git a/.github/workflows/on_pr.yml b/.github/workflows/on_pr.yml new file mode 100644 index 0000000..e1a0496 --- /dev/null +++ b/.github/workflows/on_pr.yml @@ -0,0 +1,28 @@ +name: PR Tests + +on: + pull_request: + branches: [main] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + test: + runs-on: ubuntu-latest + container: + image: ghcr.io/${{ github.repository }}:latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies with uv + run: uv sync --frozen + + - name: Run tests with pytest + run: uv run pytest From a2dc45e5eb28be7b632bfa1b0f4ba9102a73c798 Mon Sep 17 00:00:00 2001 From: Olivia Banks Date: Tue, 24 Mar 2026 09:11:07 -0600 Subject: [PATCH 2/2] [gha] remove `uv` redundancy Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/copilot.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/copilot.yml b/.github/workflows/copilot.yml index 2b9b0b8..563f016 100644 --- a/.github/workflows/copilot.yml +++ b/.github/workflows/copilot.yml @@ -16,11 +16,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v4 - with: - version: "0.5.9" - - name: Sync dependencies run: uv sync --frozen