Skip to content

Introduce GitHub Actions and Workflows#20

Open
olivia-banks wants to merge 2 commits intoEpiForeSITE:mainfrom
olivia-banks:ob-action
Open

Introduce GitHub Actions and Workflows#20
olivia-banks wants to merge 2 commits intoEpiForeSITE:mainfrom
olivia-banks:ob-action

Conversation

@olivia-banks
Copy link
Member

Fix #11 and #12.

Copilot AI review requested due to automatic review settings March 24, 2026 05:05
@olivia-banks olivia-banks self-assigned this Mar 24, 2026
@olivia-banks
Copy link
Member Author

This should be workable.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds GitHub Actions workflows to support CI on pull requests and to build/publish the project’s GHCR container image used as a dev/agent environment.

Changes:

  • Adds a PR-triggered workflow intended to run dependency sync + tests via uv.
  • Adds a manually triggered “Copilot Dev Environment” workflow that provisions dependencies in the container image.
  • Adds a main-branch workflow to build and push the ghcr.io/<owner>/<repo> container image from Containerfile.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
.github/workflows/on_pr.yml New PR CI workflow that runs uv sync and pytest inside the GHCR container image.
.github/workflows/copilot.yml New manual workflow intended to prepare a container-based dev environment for an agent.
.github/workflows/containerfile.yml New workflow to build and publish the GHCR image (latest + sha tags) from Containerfile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +14 to +18
container:
image: ghcr.io/${{ github.repository }}:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow runs tests inside ghcr.io/${{ github.repository }}:latest, which is built only after pushes to main. That means PRs can run against a stale image (or fail if no latest image exists yet), and dependency changes in the PR won’t be represented. Consider running CI directly on the runner with setup-uv/setup-python, or build the image as part of this PR workflow (without pushing) and run tests against that image.

Suggested change
container:
image: ghcr.io/${{ github.repository }}:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is an okay tradeoff, @gvegayon? Do you have experience in how long it usually takes to build similar images on GHA?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, it should be fast. But I think, overall, having a production environment makes things more robust. Sure, the CI will fail the first time, but it will only be once. Having an image to run on becomes more important as the project starts increasing in complexity (which I've seen in the past).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks. I'll resolve this conversation.

Comment on lines +12 to +19
test:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository }}:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulling from GHCR in a PR workflow often requires explicit token permissions (packages: read) and can fail for PRs from forks/private packages where the token cannot access the registry. To make this workflow reliable, add explicit permissions for packages: read (and contents: read) and/or avoid GHCR pulls for PR CI.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +24 to +32
- 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
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this workflow is meant to mirror the devcontainer setup for the “AI agent”, it currently only runs uv sync --frozen and a few echo commands; it doesn’t apply the devcontainer’s post-create steps (e.g., syncing the dev group / tool installs). Consider invoking .devcontainer/post-create.sh (or replicating its uv sync --group dev --no-install-project) so the environment matches what contributors/agents get locally.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +7 to +14
copilot:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository }}:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like on_pr.yml, this job pulls a GHCR image but does not declare permissions: packages: read. In orgs that default GITHUB_TOKEN to read-only or restrict package access, the image pull can fail. Add explicit job/workflow permissions for contents: read and packages: read to make execution more predictable.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gvegayon
Copy link
Member

@copilot open a new pull request to apply changes based on the comments in this thread

cc @olivia-banks, I think Copilot only works on this if the PR came from the same repo

@olivia-banks
Copy link
Member Author

@copilot open a new pull request to apply changes based on the comments in this thread

cc @olivia-banks, I think Copilot only works on this if the PR came from the same repo

Interesting. I see now that I didn't see

Copilot isn't available for cross-repository pull requests

I'll run a Claude session locally after my meetings and lectures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set GitHub Action for testing (setup Python using uv or similar)

3 participants