Skip to content
Open
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
16 changes: 9 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# https://github.com/microsoft/vscode-dev-containers/blob/main/containers/python-3/README.md
ARG VARIANT=3.13-bookworm
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
COPY requirements.txt /tmp/pip-tmp/
RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install --no-cache-dir -r /tmp/pip-tmp/requirements.txt \
&& pipx install pre-commit ruff
# https://github.com/devcontainers/images/tree/main/src/python
# Mirrors the image used by devcontainer.json. Dependencies live in
# pyproject.toml/uv.lock (there is no requirements.txt), so contributors
# install them with `uv sync` inside the container.
ARG VARIANT=latest
FROM mcr.microsoft.com/devcontainers/python:${VARIANT}
RUN pipx install pre-commit \
&& pipx install ruff \
&& pipx install uv
42 changes: 40 additions & 2 deletions .github/workflows/devcontainer_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,60 @@ name: Test DevContainer Build

on:
push:
branches:
- master
paths:
- ".devcontainer/**"
- ".github/workflows/devcontainer_ci.yml"
pull_request:
paths:
- ".devcontainer/**"
- ".github/workflows/devcontainer_ci.yml"
workflow_dispatch:

permissions:
contents: read

jobs:
build:
dockerfile:
name: Build .devcontainer/Dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Build the image
run: docker build --tag devcontainer-dockerfile .devcontainer
- name: Check the tools are installed
run: |
docker run --rm devcontainer-dockerfile bash -lc '
set -e
python3 --version
pre-commit --version
ruff --version
uv --version
'

devcontainer:
name: Build devcontainer and run post_install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
# Builds the container from devcontainer.json, runs postCreateCommand
# (which runs .devcontainer/post_install), then runs runCmd inside it.
- uses: devcontainers/ci@v0.3
with:
push: never
runCmd: "true"
runCmd: |
set -e
pre-commit --version
ruff --version
uv --version
test -f .git/hooks/pre-commit
ZSH_PLUGINS="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins"
test -d "$ZSH_PLUGINS/zsh-autosuggestions"
test -d "$ZSH_PLUGINS/zsh-syntax-highlighting"
grep -q '^plugins=(git zsh-autosuggestions zsh-syntax-highlighting)' ~/.zshrc
echo "Devcontainer initialization verified."
Loading