diff --git a/actions/actions.sh b/actions/actions.sh index b1e6bd8a..aa2401e8 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -143,7 +143,7 @@ function test_actions() { done fi - for example in shell echo lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do + for example in echo lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do run actions_verify_example $example done @@ -151,6 +151,10 @@ function test_actions() { run actions_verify_example cache-proxy fi + if dpkg --compare-versions $runner_version ge 8.0.0; then + run actions_verify_example shell + fi + if dpkg --compare-versions $version lt 7.1; then for example in cron; do run actions_verify_example $example diff --git a/actions/example-shell/.forgejo/workflows/test.yml b/actions/example-shell/.forgejo/workflows/test.yml index 38a2a6cd..67c9f989 100644 --- a/actions/example-shell/.forgejo/workflows/test.yml +++ b/actions/example-shell/.forgejo/workflows/test.yml @@ -12,10 +12,29 @@ jobs: run: | ${{ env.ASSERT_SHELL }} /bash - defaults-run: + sh-fallback: needs: [default] # alpine:docker://code.forgejo.org/oci/alpine:latest runs-on: alpine + steps: + - name: default is bash but with a fallback to sh in case it does not exist + run: | + ${{ env.ASSERT_SHELL }} /busybox + + sh-fallback-with-container: + needs: [sh-fallback] + runs-on: docker + container: + image: code.forgejo.org/oci/alpine:latest + steps: + - name: default is bash but with a fallback to sh in case it does not exist + run: | + ${{ env.ASSERT_SHELL }} /busybox + + defaults-run: + needs: [sh-fallback-with-container] + # alpine:docker://code.forgejo.org/oci/alpine:latest + runs-on: alpine defaults: run: shell: sh @@ -24,16 +43,6 @@ jobs: run: | ${{ env.ASSERT_SHELL }} /busybox - alpine: - needs: [defaults-run] - runs-on: docker - container: - image: code.forgejo.org/oci/alpine:latest - steps: - - name: default is sh which is an alias for busybox in alpine - run: | - ${{ env.ASSERT_SHELL }} /busybox - python: needs: [alpine] runs-on: docker @@ -51,9 +60,9 @@ jobs: container: image: code.forgejo.org/oci/node:22-bookworm steps: - - name: default is sh which is an alias for dash in bookworm + - name: default is bash run: | - ${{ env.ASSERT_SHELL }} /dash + ${{ env.ASSERT_SHELL }} /bash - name: bash => bash --noprofile --norc -e -o pipefail {0} shell: bash