-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (69 loc) · 2.01 KB
/
_e2e.yaml
File metadata and controls
77 lines (69 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: E2E Tests
on:
workflow_call:
inputs:
func-version:
required: true
type: string
# Empty = run all e2e tests, or specify one (e.g. "python/keycloak-auth")
tests:
required: false
type: string
default: ''
jobs:
resolve:
runs-on: ubuntu-latest
outputs:
tests: ${{ steps.find-tests.outputs.tests }}
has_tests: ${{ steps.find-tests.outputs.has_tests }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Find e2e tests to run
id: find-tests
run: |
if [ -n "${{ inputs.tests }}" ]; then
matched="${{ inputs.tests }}"
else
matched=$(find .testing -mindepth 3 -maxdepth 3 -name "test.sh" | while read -r f; do
rel="${f#.testing/}"
dirname "$rel"
done | sort)
fi
if [ -n "$matched" ]; then
json=$(echo "$matched" | xargs -n1 | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "tests=$json" >> $GITHUB_OUTPUT
echo "has_tests=true" >> $GITHUB_OUTPUT
echo "Will run e2e tests: $matched"
else
echo "tests=[]" >> $GITHUB_OUTPUT
echo "has_tests=false" >> $GITHUB_OUTPUT
echo "No e2e tests found"
fi
e2e:
needs: resolve
if: needs.resolve.outputs.has_tests == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test: ${{ fromJSON(needs.resolve.outputs.tests) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install func
uses: functions-dev/action@main
with:
version: ${{ inputs.func-version }}
name: func
- name: Setup Ollama
run: |
curl -fsSL https://ollama.com/install.sh | sh
ollama serve &
for i in $(seq 1 30); do
curl -sf http://localhost:11434/api/tags && break
sleep 2
done
- name: Run e2e test
run: |
./.testing/run-e2e.sh ${{ matrix.test }} --verbose