Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 77786f9

Browse files
authored
Fix regression test (CI Ignore)
1 parent 200ce9c commit 77786f9

File tree

3 files changed

+98
-1
lines changed

3 files changed

+98
-1
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: 'VSCDC smoke test'
2+
inputs:
3+
definition:
4+
description: 'Definition to test'
5+
required: true
6+
default: 'debian'
7+
image:
8+
description: 'Image to run smoke test in'
9+
required: true
10+
default: 'none'
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Build image
16+
id: build_image
17+
shell: bash
18+
run: |
19+
set -e
20+
21+
# Run test build
22+
yarn install
23+
GIT_BRANCH=$(echo "${{ github.ref }}" | grep -oP 'refs/(heads|tags)/\K(.+)')
24+
if [ "$GIT_BRANCH" == "" ]; then
25+
GIT_BRANCH=main
26+
fi
27+
chmod +x build/vscdc
28+
build/vscdc push ${{ inputs.definition }} \
29+
--no-push \
30+
--release $GIT_BRANCH \
31+
--github-repo "microsoft/vscode-dev-containers" \
32+
--registry "mcr.microsoft.com" \
33+
--registry-path "vscode/devcontainers" \
34+
--stub-registry "mcr.microsoft.com" \
35+
--stub-registry-path "vscode/devcontainers"
36+
37+
- name: Test image
38+
id: test_image
39+
shell: bash
40+
run: |
41+
if [ "${{ inputs.image }}" = "none" ]; then
42+
echo "Image not specified. Skipping test."
43+
exit 0
44+
fi
45+
46+
set -e
47+
48+
# Fake out existance of extensions, VS Code server
49+
dev_container_relative_path="/containers/${{ inputs.definition }}/.devcontainer"
50+
mkdir -p "/tmp/${dev_container_relative_path}"
51+
cp -f $(pwd)/${dev_container_relative_path}/devcontainer.json "/tmp/${dev_container_relative_path}/"
52+
dev_container_tmp="/tmp/${dev_container_relative_path}/devcontainer.json"
53+
sed -i'.bak' -e "s/\\/\\/.*/ /g" "${dev_container_tmp}"
54+
extensions="$(jq '.extensions' --compact-output "${dev_container_tmp}" | tr -d '[' | tr -d ']' | tr ',' ' ') 2>/dev/null || echo ''"
55+
docker run --rm --init --privileged -u "${{ inputs.user }}" "${{ inputs.image }}" /bin/sh -c "\
56+
mkdir -p \"\$HOME/.vscode-test-server/extensions\" \
57+
cd \"\$HOME/.vscode-test-server/extensions\" \
58+
if [ \"${extensions}\" != '' ]; then echo \"${extensions}\" | xargs -n 1 mkdir -p; fi"
59+
60+
# Run actual test
61+
docker run --rm --init --privileged -u "${{ inputs.user }}" -v "$(pwd)/containers/${{ inputs.definition }}:/workspace" "${{ inputs.image }}" /bin/sh -c '\
62+
set -e
63+
cd /workspace \
64+
&& if [ -f "test-project/test.sh" ]; then \
65+
cd test-project \
66+
&& if [ "$(id -u)" = "0" ]; then \
67+
chmod +x test.sh; \
68+
else \
69+
sudo chmod +x test.sh; \
70+
fi \
71+
&& ./test.sh; \
72+
else \
73+
ls -a;
74+
fi'
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Smoke test "debian" build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [actions-test]
7+
paths:
8+
- 'containers/debian/**'
9+
jobs:
10+
smoke-test:
11+
name: Smoke test
12+
if: "!contains(github.event.head_commit.message, 'Automated update') && !contains(github.event.head_commit.message, 'CI ignore')"
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
id: checkout
17+
uses: actions/checkout@v2
18+
- name: Smoke test
19+
id: smoke_test
20+
uses: ./.github/actions/smoke-test
21+
with:
22+
definition: debian
23+
image: mcr.microsoft.com/vscode/devcontainers/base:dev-debian

containers/dotnet/.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"args": {
66
// Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0
77
// Append -bullseye or -focal to pin to an OS version.
8-
"VARIANT": "5.0-bullseye",
8+
"VARIANT": "5.0",
99
// Options
1010
"NODE_VERSION": "lts/*"
1111
}

0 commit comments

Comments
 (0)