Skip to content

Commit 51c957d

Browse files
committed
ci: another try to make CodeSpaces CI fail if the prebuilt packages are not provided
1 parent a8f70b4 commit 51c957d

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

.devcontainer/check_all.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@
66

77
set -e
88

9-
# Auto-detect CI environment and use "never" build policy
10-
if [[ -n "${CI:-}" ]]; then
11-
build_policy="never"
12-
else
13-
build_policy="missing"
14-
fi
15-
9+
build_policy="missing"
1610
while getopts :hdn opt
1711
do
1812
case $opt in

.devcontainer/devcontainer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// Dockerfile: https://github.com/train-it-eu/docker-images/blob/main/mp-units/Dockerfile
55
"image": "trainiteu/mp-units:latest",
66
"remoteUser": "ubuntu",
7+
"containerEnv": {
8+
"CI_NEVER_BUILD": "${localEnv:CI_NEVER_BUILD}"
9+
},
710
"mounts": [
811
"source=conan-cache,target=/home/ubuntu/.conan2,type=volume",
912
"source=pipx-cache,target=/home/ubuntu/.pipx,type=volume"
@@ -74,7 +77,7 @@
7477
"--init"
7578
],
7679
"updateContentCommand": "sudo mkdir -p /workspaces/api_reference_deps && sudo chown -R ubuntu:ubuntu /workspaces/api_reference_deps",
77-
"postCreateCommand": "pipx upgrade-all && .devcontainer/validate_environment.sh && .devcontainer/check_all.sh -d install && .devcontainer/api_reference.sh -s",
80+
"postCreateCommand": "bash -c 'pipx upgrade-all && .devcontainer/validate_environment.sh && .devcontainer/check_all.sh -d ${CI_NEVER_BUILD:+-n} install && .devcontainer/api_reference.sh -s'",
7881
"postStartCommand": "echo '🚀 mp-units development environment ready!' && echo '🧪 Use `.devcontainer/check_all.sh [-d] build` to test all compiler configurations.' && echo '📖 Use `.devcontainer/api_reference.sh` to generate the API reference documentation.'",
7982
"forwardPorts": [
8083
8000

.github/workflows/codespaces-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ jobs:
4949

5050
- name: Test Dev Container Build and Setup
5151
uses: devcontainers/ci@v0.3.1900000417
52+
env:
53+
CI_NEVER_BUILD: "1"
5254
with:
5355
imageName: mp-units-dev
5456
cacheFrom: mp-units-dev
5557
push: never
56-
runCmd: echo "✅ Devcontainer build and setup completed successfully with pre-built packages only"
58+
runCmd: echo "✅ Devcontainer setup completed successfully with pre-built packages only"

0 commit comments

Comments
 (0)