diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 01cc10a..821ba21 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -57,3 +57,41 @@ jobs: echo "$LETTER does not equal 'h'" exit 1 fi + + test-without-python: + name: Test (no Python preinstalled) + runs-on: ubuntu-latest + container: + image: ubuntu:latest + steps: + - name: ๐Ÿ“ฆ Install git + run: | + apt-get update + apt-get install -y --no-install-recommends git ca-certificates + + - name: ๐Ÿงช Assert Python is not preinstalled + run: | + if command -v python3 >/dev/null 2>&1 || command -v python >/dev/null 2>&1 + then + echo "Python is preinstalled; this test requires an image without it" + exit 1 + fi + + - name: ๐Ÿšš Checkout project + uses: actions/checkout@v6 + + - name: Test Single Line + id: test + uses: ./ + with: + ref: refs/tags/@johngw/my-package-v1.2.3 + regex: refs/tags/(?P@johngw/[a-zA-Z0-9_-]+)-v(?P\d+.\d+.\d+)$ + + - name: ๐Ÿงช Assert Package + run: | + PACKAGE='${{ fromJSON(steps.test.outputs.groups).package }}' + if [[ $PACKAGE != '@johngw/my-package' ]] + then + echo "$PACKAGE does not equal '@johngw/my-package'" + exit 1 + fi