Skip to content

Commit c701672

Browse files
author
Antonio Salinas
authored
test: Added test to check devcontainer successfully builds (#360)
* Added build test for devcontainer * Edit start docker script for option to run dockerd without sudo * Point test to dockerfile * Logging and formatting changes * Add env for docker in docker support in ci * Conditionally execute docker start script on creation * Set CI env to skip docker start script * Testing if we can test docker in docker * Add npm dependency for devcontainer on github actions * Install nodejs on the runner itself * Also need to preinstall devcontainers * Using decontainer tool directly now * Formatting changes * Added timeout to devcontainer test
1 parent aec431d commit c701672

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/devcontainer.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "Check devcontainer build"
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
workflow_dispatch:
8+
schedule:
9+
# Run every night at 3:15am PST (11:15am UTC)
10+
- cron: '15 11 * * *'
11+
12+
# Cancel in-progress runs of this workflow if a new run is triggered.
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
15+
cancel-in-progress: true
16+
17+
permissions: {}
18+
19+
jobs:
20+
devcontainer:
21+
name: "Devcontainer build"
22+
runs-on:
23+
- self-hosted
24+
- 1ES.Pool=azl_dev_gh_runner_amd64
25+
permissions:
26+
contents: read
27+
steps:
28+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
with:
30+
persist-credentials: false
31+
- name: Install Nodejs and npm
32+
run: |
33+
sudo tdnf install -y nodejs npm
34+
sudo npm install -g @devcontainers/cli
35+
- name: Build devcontainer
36+
timeout-minutes: 10
37+
run: |
38+
echo "Building devcontainer..."
39+
devcontainer build --workspace-folder . --image-name azldev-devcontainer:test
40+
echo "Running devcontainer to verify it works..."
41+
devcontainer up --workspace-folder .
42+
43+
echo "Devcontainer built successfully!"

0 commit comments

Comments
 (0)