mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
chore: local action name collision regression tests
If the tag name collide (e.g. v9.1.1), it will fail with:
```
[push.yml/test] [DEBUG] Working directory '/home/earl-warren/software/runner/act/runner/testdata/local-action-dockerfile-tag/example2'
[push.yml/test] ❌ Failure - Main [[ "example1 SOMEONE" == "example2 SOMEONE" ]]
```
This commit is contained in:
parent
d29cba2946
commit
7efe25f13d
10 changed files with 74 additions and 0 deletions
|
@ -245,6 +245,8 @@ func TestRunner_RunEvent(t *testing.T) {
|
||||||
{workdir, "local-action-fails-schema-validation", "push", "Job 'test' failed", platforms, secrets},
|
{workdir, "local-action-fails-schema-validation", "push", "Job 'test' failed", platforms, secrets},
|
||||||
{workdir, "local-action-docker-url", "push", "", platforms, secrets},
|
{workdir, "local-action-docker-url", "push", "", platforms, secrets},
|
||||||
{workdir, "local-action-dockerfile", "push", "", platforms, secrets},
|
{workdir, "local-action-dockerfile", "push", "", platforms, secrets},
|
||||||
|
{workdir + "/local-action-dockerfile-tag/example1", "local-action-dockerfile-example1", "push", "", platforms, secrets},
|
||||||
|
{workdir + "/local-action-dockerfile-tag/example2", "local-action-dockerfile-example2", "push", "", platforms, secrets},
|
||||||
{workdir, "local-action-via-composite-dockerfile", "push", "", platforms, secrets},
|
{workdir, "local-action-via-composite-dockerfile", "push", "", platforms, secrets},
|
||||||
{workdir, "local-action-js", "push", "", platforms, secrets},
|
{workdir, "local-action-js", "push", "", platforms, secrets},
|
||||||
|
|
||||||
|
|
4
act/runner/testdata/local-action-dockerfile-tag/README.txt
vendored
Normal file
4
act/runner/testdata/local-action-dockerfile-tag/README.txt
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
example1 and example2 eacho use a local actions that have the same
|
||||||
|
path (actions/docker-local) but do not behave the same. This verifies
|
||||||
|
that the locally built images have different names and do not collide
|
||||||
|
despite both being called with `uses: ./actions/docker-local.
|
8
act/runner/testdata/local-action-dockerfile-tag/example1/actions/docker-local/Dockerfile
vendored
Normal file
8
act/runner/testdata/local-action-dockerfile-tag/example1/actions/docker-local/Dockerfile
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Container image that runs your code
|
||||||
|
FROM code.forgejo.org/oci/alpine:latest
|
||||||
|
|
||||||
|
# Copies your code file from your action repository to the filesystem path `/` of the container
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
# Code file to execute when the docker container starts up (`entrypoint.sh`)
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
12
act/runner/testdata/local-action-dockerfile-tag/example1/actions/docker-local/action.yml
vendored
Normal file
12
act/runner/testdata/local-action-dockerfile-tag/example1/actions/docker-local/action.yml
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
inputs:
|
||||||
|
who-to-greet:
|
||||||
|
outputs:
|
||||||
|
whoami:
|
||||||
|
description: 'The time we greeted you'
|
||||||
|
runs:
|
||||||
|
using: 'docker'
|
||||||
|
image: 'Dockerfile'
|
||||||
|
env:
|
||||||
|
WHOAMI: ${{ inputs.who-to-greet }}
|
||||||
|
args:
|
||||||
|
- ${{ inputs.who-to-greet }}
|
3
act/runner/testdata/local-action-dockerfile-tag/example1/actions/docker-local/entrypoint.sh
vendored
Executable file
3
act/runner/testdata/local-action-dockerfile-tag/example1/actions/docker-local/entrypoint.sh
vendored
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo ::set-output "name=whoami::example1 $WHOAMI"
|
|
@ -0,0 +1,11 @@
|
||||||
|
on: push
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./actions/docker-local
|
||||||
|
id: dockerlocal
|
||||||
|
with:
|
||||||
|
who-to-greet: 'SOMEONE'
|
||||||
|
- run: '[[ "${{ steps.dockerlocal.outputs.whoami }}" == "example1 SOMEONE" ]]'
|
8
act/runner/testdata/local-action-dockerfile-tag/example2/actions/docker-local/Dockerfile
vendored
Normal file
8
act/runner/testdata/local-action-dockerfile-tag/example2/actions/docker-local/Dockerfile
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Container image that runs your code
|
||||||
|
FROM code.forgejo.org/oci/alpine:latest
|
||||||
|
|
||||||
|
# Copies your code file from your action repository to the filesystem path `/` of the container
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
# Code file to execute when the docker container starts up (`entrypoint.sh`)
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
12
act/runner/testdata/local-action-dockerfile-tag/example2/actions/docker-local/action.yml
vendored
Normal file
12
act/runner/testdata/local-action-dockerfile-tag/example2/actions/docker-local/action.yml
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
inputs:
|
||||||
|
who-to-greet:
|
||||||
|
outputs:
|
||||||
|
whoami:
|
||||||
|
description: 'The time we greeted you'
|
||||||
|
runs:
|
||||||
|
using: 'docker'
|
||||||
|
image: 'Dockerfile'
|
||||||
|
env:
|
||||||
|
WHOAMI: ${{ inputs.who-to-greet }}
|
||||||
|
args:
|
||||||
|
- ${{ inputs.who-to-greet }}
|
3
act/runner/testdata/local-action-dockerfile-tag/example2/actions/docker-local/entrypoint.sh
vendored
Executable file
3
act/runner/testdata/local-action-dockerfile-tag/example2/actions/docker-local/entrypoint.sh
vendored
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo ::set-output "name=whoami::example2 $WHOAMI"
|
|
@ -0,0 +1,11 @@
|
||||||
|
on: push
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./actions/docker-local
|
||||||
|
id: dockerlocal
|
||||||
|
with:
|
||||||
|
who-to-greet: 'SOMEONE'
|
||||||
|
- run: '[[ "${{ steps.dockerlocal.outputs.whoami }}" == "example2 SOMEONE" ]]'
|
Loading…
Add table
Add a link
Reference in a new issue