File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 workflow_dispatch :
88
99jobs :
10- test-autogenerated :
11- runs-on : ubuntu-latest
12- continue-on-error : true
13- strategy :
14- matrix :
15- features :
16- - lefthook
17- baseImage :
18- - debian:latest
19- - ubuntu:latest
20- - mcr.microsoft.com/devcontainers/base:ubuntu
21- steps :
22- - uses : actions/checkout@v4
23-
24- - name : " Install latest devcontainer CLI"
25- run : npm install -g @devcontainers/cli
26-
27- - name : " Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
28- run : devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .
29-
3010 test-scenarios :
3111 runs-on : ubuntu-latest
3212 continue-on-error : true
3313 strategy :
3414 matrix :
35- features :
36- - lefthook
37- - go-air
15+ images :
16+ - mcr.microsoft.com/devcontainers/base:debian
17+ - mcr.microsoft.com/devcontainers/base:ubuntu
3818 steps :
3919 - uses : actions/checkout@v4
4020
4121 - name : " Install latest devcontainer CLI"
4222 run : npm install -g @devcontainers/cli
4323
44- - name : " Generating tests for ' ${{ matrix.features }}' scenarios "
45- run : devcontainer features test -f ${{ matrix.features }} --skip-autogenerated --skip-duplicated .
24+ - name : " Generating tests for all scenarios against ${{ matrix.images }}"
25+ run : devcontainer features test -i ${{ matrix.images }} .
4626
4727 test-global :
4828 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 2121 "args" : [
2222 " features" ,
2323 " test" ,
24- " --skip-scenarios" ,
2524 " -f" ,
2625 " ${input:selectedFeatures}" ,
2726 " -i" ,
5958 "id" : " selectedBaseImage" ,
6059 "type" : " promptString" ,
6160 "description" : " Base Image" ,
62- "default" : " mcr.microsoft.com/vscode/devcontainers/base:ubuntu "
61+ "default" : " mcr.microsoft.com/vscode/devcontainers/base:debian "
6362 }
6463 ]
6564}
Original file line number Diff line number Diff line change 11{
22 "name" : " Air" ,
33 "id" : " go-air" ,
4- "version" : " 1.1.0 " ,
4+ "version" : " 1.1.1 " ,
55 "documentationURL" : " http://github.com/omoxyz/devcontainer-features/tree/main/src/go-air" ,
66 "description" : " Install Air live reloader for Go apps." ,
77 "options" : {
Original file line number Diff line number Diff line change @@ -76,13 +76,8 @@ install_from_github() {
7676 rm -rf /tmp/air
7777}
7878
79- # Install curl if missing
80- check_packages curl ca-certificates
81-
82- # Install git if missing
83- if ! type git > /dev/null 2>&1 ; then
84- check_packages git
85- fi
79+ # Install curl, git if missing
80+ check_packages curl ca-certificates git
8681
8782version_list=$( git ls-remote --tags ${GITHUB_REPO} )
8883
Original file line number Diff line number Diff line change @@ -10,11 +10,24 @@ apt_get_update() {
1010
1111# Checks if packages are installed and installs them if not
1212check_packages () {
13- if ! dpkg -s " $@ " > /dev/null 2>&1 ; then
13+ for pkg in " $@ " ; do
14+ # Check if it's a command in PATH
15+ if command -v " $pkg " & > /dev/null; then
16+ echo " [OK] $pkg found in PATH"
17+ continue
18+ fi
19+
20+ # Check if it's a Debian/Ubuntu package installed
21+ if dpkg -s " $pkg " & > /dev/null; then
22+ echo " [OK] $pkg package installed"
23+ continue
24+ fi
25+
26+ # If not found, install package
27+ echo " $pkg not found. Installing..."
1428 apt_get_update
15- echo " Installing $@ ..."
16- apt-get install -y --no-install-recommends $@
17- fi
29+ apt-get install -y --no-install-recommends $pkg
30+ done
1831}
1932
2033# Find 2 latest versions that appropriate to requested version
Original file line number Diff line number Diff line change 11{
22 "name" : " Lefthook" ,
33 "id" : " lefthook" ,
4- "version" : " 1.0.2 " ,
4+ "version" : " 1.0.3 " ,
55 "documentationURL" : " http://github.com/omoxyz/devcontainer-features/tree/main/src/lefthook" ,
66 "description" : " Install Lefthook fast polyglot Git hooks manager." ,
77 "options" : {
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ install_from_github() {
3737 fi
3838
3939 latest_version=${versions[0]}
40- prev_version=${versions[1]}
40+ prev_version=${versions[1]:- $latest_version }
4141
4242
4343 echo " Downloading lefthook v${latest_version} ...."
@@ -90,9 +90,7 @@ check_packages curl ca-certificates
9090# Install Lefthook
9191if [ " ${INSTALL_DIRECTLY_FROM_GITHUB_RELEASE} " = " true" ]; then
9292 # Install git if missing
93- if ! type git > /dev/null 2>&1 ; then
94- check_packages git
95- fi
93+ check_packages git
9694
9795 install_from_github
9896else
Original file line number Diff line number Diff line change @@ -10,11 +10,25 @@ apt_get_update() {
1010
1111# Checks if packages are installed and installs them if not
1212check_packages () {
13- if ! dpkg -s " $@ " > /dev/null 2>&1 ; then
13+ for pkg in " $@ " ; do
14+ # Check if it's a command in PATH
15+ if command -v " $pkg " & > /dev/null; then
16+ echo " [OK] $pkg found in PATH"
17+ continue
18+ fi
19+
20+ # Check if it's a Debian/Ubuntu package installed
21+ if dpkg -s " $pkg " & > /dev/null; then
22+ echo " [OK] $pkg package installed"
23+ continue
24+ fi
25+
26+ # If not found, install package
27+ echo " $pkg not found. Installing..."
1428 apt_get_update
15- echo " Installing $@ ... "
16- apt-get install -y --no-install-recommends $@
17- fi
29+ apt-get install -y --no-install-recommends $pkg
30+
31+ done
1832}
1933
2034# Find 2 latest versions that appropriate to requested version
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ install_from_github() {
3737 fi
3838
3939 latest_version=${versions[0]}
40- prev_version=${versions[1]}
40+ prev_version=${versions[1]:- $latest_version }
4141
4242 echo " Downloading protolint v${latest_version} ...."
4343
Original file line number Diff line number Diff line change 22 "test" : {
33 "image" : " mcr.microsoft.com/devcontainers/base:debian" ,
44 "features" : {
5- "protoc " : {}
5+ "protolint " : {}
66 }
77 }
88}
You can’t perform that action at this time.
0 commit comments