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
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "colcon-cache",
"image": "python:3",
"workspaceFolder": "/workspace/colcon-cache",
"workspaceMount": "source=${localWorkspaceFolder},target=${containerWorkspaceFolder},type=bind",
"onCreateCommand": ".devcontainer/on-create-command.sh",
"postCreateCommand": ".devcontainer/post-create-command.sh",
"features": {
"ghcr.io/devcontainers-contrib/features/apt-get-packages:1": {
"packages": [
"jq",
]
},
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"ms-python.python"
]
}
}
}
24 changes: 24 additions & 0 deletions .devcontainer/on-create-command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# Immediately catch all errors
set -eo pipefail

# Uncomment for debugging
# set -x
# env

git config --global --add safe.directory "*"

COLCON_CI_URL=https://github.com/colcon/ci/archive/refs/heads/main.zip
curl -sSL $COLCON_CI_URL > /tmp/main.zip
unzip /tmp/main.zip -d /tmp/
GITHUB_ACTION_PATH=/tmp/ci-main

PKG_NAME=$(pip list -l -e --format json | jq '.[0].name' -r | tr _ -)
cp -a ${GITHUB_ACTION_PATH}/constraints{,-heads,-pins}.txt ./
sed -i.orig "s/^${PKG_NAME}@.*//g" constraints-heads.txt
# Install dependencies, including 'test' extras, as well as pytest-cov
python -m pip install -U -e .[test] pytest-cov -c constraints.txt

# cleanup temp files
rm constraints*.txt*
11 changes: 11 additions & 0 deletions .devcontainer/post-create-command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Immediately catch all errors
set -eo pipefail

# Uncomment for debugging
# set -x
# env

# Enable autocomplete for user
cp /etc/skel/.bashrc ~/
6 changes: 0 additions & 6 deletions .dockerignore

This file was deleted.

15 changes: 13 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,16 @@
"sched",
"subverb",
"subverbs"
]
}
],
"python.languageServer": "Default",
"python.testing.pytestArgs": [
"--cov",
"--cov-branch",
"--cov-report",
"xml:coverage.xml",
"--cov-config",
"setup.cfg"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
16 changes: 0 additions & 16 deletions Dockerfile

This file was deleted.