Skip to content

Commit 0ec61b6

Browse files
committed
Run e2e-tests against the built image
1 parent fbcabeb commit 0ec61b6

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/ci-cd.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,45 @@ jobs:
7272
with:
7373
name: elixir_script
7474
path: /tmp/elixir_script.tar
75+
76+
e2e-tests:
77+
needs: [ build ]
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
data:
82+
- name: "return"
83+
script: |
84+
"return"
85+
expected: "return"
86+
87+
- name: "context"
88+
script: |
89+
Map.keys(context)
90+
expected: "[__struct__,action,actor,api_url,event_name,graphql_url,job,payload,ref,run_id,run_number,server_url,sha,workflow]"
91+
runs-on: ubuntu-latest
92+
name: "e2e tests (${{ matrix.data.name }})"
93+
steps:
94+
- uses: actions/checkout@v3
95+
- name: Download artifact
96+
uses: actions/download-artifact@v3
97+
with:
98+
name: elixir_script
99+
path: /tmp
100+
- name: Load image
101+
run: docker load --input /tmp/elixir_script.tar
102+
- name: Update action.yml to point to elixir_script:test
103+
run: |
104+
sed -i 's/\( image: \).*/\1elixir_script:test/' action.yml
105+
- name: Run gaggle/elixir_script
106+
id: run
107+
uses: ./
108+
with:
109+
script: |
110+
${{ matrix.data.script }}
111+
- name: Assert output
112+
run: |
113+
expected="${{ matrix.data.expected }}"
114+
output="${{steps.run.outputs.result}}"
115+
[[ "$output" != "$expected" ]] && echo "::error::❌ Expected '$expected', got '$output'" && exit 1
116+
echo "✅ Test passed, outputs.result: ${{toJSON(steps.run.outputs.result)}}"

0 commit comments

Comments
 (0)