diff options
author | Daniel Baumann <daniel@debian.org> | 2024-10-20 23:07:42 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2024-11-09 15:38:42 +0100 |
commit | 714c83b2736d7e308bc33c49057952490eb98be2 (patch) | |
tree | 1d9ba7035798368569cd49056f4d596efc908cd8 /pkg/runner/testdata/shells | |
parent | Initial commit. (diff) | |
download | forgejo-act-714c83b2736d7e308bc33c49057952490eb98be2.tar.xz forgejo-act-714c83b2736d7e308bc33c49057952490eb98be2.zip |
Adding upstream version 1.21.4.HEADupstream/1.21.4upstreamdebian
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'pkg/runner/testdata/shells')
-rw-r--r-- | pkg/runner/testdata/shells/bash/push.yml | 37 | ||||
-rw-r--r-- | pkg/runner/testdata/shells/custom/push.yml | 14 | ||||
-rw-r--r-- | pkg/runner/testdata/shells/defaults/push.yml | 21 | ||||
-rw-r--r-- | pkg/runner/testdata/shells/pwsh/push.yml | 25 | ||||
-rw-r--r-- | pkg/runner/testdata/shells/python/push.yml | 28 | ||||
-rw-r--r-- | pkg/runner/testdata/shells/sh/push.yml | 37 |
6 files changed, 162 insertions, 0 deletions
diff --git a/pkg/runner/testdata/shells/bash/push.yml b/pkg/runner/testdata/shells/bash/push.yml new file mode 100644 index 0000000..49704b2 --- /dev/null +++ b/pkg/runner/testdata/shells/bash/push.yml @@ -0,0 +1,37 @@ +on: push +env: + MY_SHELL: bash +jobs: + check: + runs-on: ubuntu-latest + steps: + - shell: ${{ env.MY_SHELL }} + run: | + if [[ -n "$BASH" ]]; then + echo "I'm $BASH!" + else + exit 1 + fi + check-container: + runs-on: ubuntu-latest + container: node:16-buster-slim + steps: + - shell: ${{ env.MY_SHELL }} + run: | + if [[ -n "$BASH" ]]; then + echo "I'm $BASH!" + else + exit 1 + fi + check-job-default: + runs-on: ubuntu-latest + defaults: + run: + shell: ${{ env.MY_SHELL }} + steps: + - run: | + if [[ -n "$BASH" ]]; then + echo "I'm $BASH!" + else + exit 1 + fi diff --git a/pkg/runner/testdata/shells/custom/push.yml b/pkg/runner/testdata/shells/custom/push.yml new file mode 100644 index 0000000..cbc0395 --- /dev/null +++ b/pkg/runner/testdata/shells/custom/push.yml @@ -0,0 +1,14 @@ +on: push +jobs: + check: + runs-on: ubuntu-latest + steps: + # prints version and exits, it's not valid (for github) if {0} is not included + - shell: pwsh -v '. {0}' + run: '' + check-container: + runs-on: ubuntu-latest + container: catthehacker/ubuntu:pwsh-latest + steps: + - shell: pwsh -v '. {0}' + run: '' diff --git a/pkg/runner/testdata/shells/defaults/push.yml b/pkg/runner/testdata/shells/defaults/push.yml new file mode 100644 index 0000000..0b0204a --- /dev/null +++ b/pkg/runner/testdata/shells/defaults/push.yml @@ -0,0 +1,21 @@ +on: push +jobs: + check: # GHA uses `bash` as default for runners + runs-on: ubuntu-latest + steps: + - run: | + if [[ -n "$BASH" ]]; then + echo "I'm $BASH!" + else + exit 1 + fi + check-container: # GHA uses `sh` as default for containers + runs-on: ubuntu-latest + container: alpine:latest + steps: + - run: | + if [ -z ${BASH+x} ]; then + echo "I'm sh!" + else + exit 1 + fi diff --git a/pkg/runner/testdata/shells/pwsh/push.yml b/pkg/runner/testdata/shells/pwsh/push.yml new file mode 100644 index 0000000..25ce66b --- /dev/null +++ b/pkg/runner/testdata/shells/pwsh/push.yml @@ -0,0 +1,25 @@ +on: push +env: + MY_SHELL: pwsh +jobs: + check: + runs-on: ubuntu-latest + steps: + - shell: ${{ env.MY_SHELL }} + run: | + $PSVersionTable + check-container: + runs-on: ubuntu-latest + container: catthehacker/ubuntu:pwsh-latest + steps: + - shell: ${{ env.MY_SHELL }} + run: | + $PSVersionTable + check-job-default: + runs-on: ubuntu-latest + defaults: + run: + shell: ${{ env.MY_SHELL }} + steps: + - run: | + $PSVersionTable diff --git a/pkg/runner/testdata/shells/python/push.yml b/pkg/runner/testdata/shells/python/push.yml new file mode 100644 index 0000000..6480e6f --- /dev/null +++ b/pkg/runner/testdata/shells/python/push.yml @@ -0,0 +1,28 @@ +on: push +env: + MY_SHELL: python +jobs: + check: + runs-on: ubuntu-latest + steps: + - shell: ${{ env.MY_SHELL }} + run: | + import platform + print(platform.python_version()) + check-container: + runs-on: ubuntu-latest + container: node:16-buster + steps: + - shell: ${{ env.MY_SHELL }} + run: | + import platform + print(platform.python_version()) + check-job-default: + runs-on: ubuntu-latest + defaults: + run: + shell: ${{ env.MY_SHELL }} + steps: + - run: | + import platform + print(platform.python_version()) diff --git a/pkg/runner/testdata/shells/sh/push.yml b/pkg/runner/testdata/shells/sh/push.yml new file mode 100644 index 0000000..0914ca2 --- /dev/null +++ b/pkg/runner/testdata/shells/sh/push.yml @@ -0,0 +1,37 @@ +on: push +env: + MY_SHELL: sh +jobs: + check: + runs-on: ubuntu-latest + steps: + - shell: ${{ env.MY_SHELL }} + run: | + if [ -z ${BASH+x} ]; then + echo "I'm sh!" + else + exit 1 + fi + check-container: + runs-on: ubuntu-latest + container: alpine:latest + steps: + - shell: ${{ env.MY_SHELL }} + run: | + if [ -z ${BASH+x} ]; then + echo "I'm sh!" + else + exit 1 + fi + check-job-default: + runs-on: ubuntu-latest + defaults: + run: + shell: ${{ env.MY_SHELL }} + steps: + - run: | + if [ -z ${BASH+x} ]; then + echo "I'm sh!" + else + exit 1 + fi |