Skip to content

Commit d3597a9

Browse files
committed
add test to CI
1 parent c8e580f commit d3597a9

File tree

4 files changed

+25
-12
lines changed

4 files changed

+25
-12
lines changed

.github/workflows/release.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77

88
jobs:
99
deploy:
10-
if: ${{ github.ref == 'refs/heads/main' }}
1110
runs-on: ubuntu-latest
1211
permissions:
1312
contents: write

.github/workflows/test.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,3 @@ jobs:
2525
- name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
2626
run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .
2727

28-
test-global:
29-
runs-on: ubuntu-latest
30-
continue-on-error: true
31-
steps:
32-
- uses: actions/checkout@v4
33-
34-
- name: "Install latest devcontainer CLI"
35-
run: npm install -g @devcontainers/cli
36-
37-
- name: "Testing global scenarios"
38-
run: devcontainer features test --global-scenarios-only .

test/bash-config/scenarios.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"hello": {
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4+
"features": {
5+
"bash-config": {}
6+
}
7+
}
8+
}

test/bash-config/test.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Import test library bundled with the devcontainer CLI
6+
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
7+
# Provides the 'check' and 'reportResults' commands.
8+
source dev-container-features-test-lib
9+
10+
# Feature-specific tests
11+
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
12+
# check <LABEL> <cmd> [args...]
13+
check "execute command" bash -c "test $HISTFILE == $CONFIG_FOLDER/.bash_eternal_history"
14+
15+
# Report results
16+
# If any of the checks above exited with a non-zero exit code, the test will fail.
17+
reportResults

0 commit comments

Comments
 (0)