-
Notifications
You must be signed in to change notification settings - Fork 32
99 lines (85 loc) · 2.69 KB
/
check_examples.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Test client examples
permissions:
contents: read
concurrency:
group: examples-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
branches: [master]
workflow_dispatch:
env:
K3D_VERSION: v5.4.1
jobs:
test-skip-check:
uses: ./.github/workflows/skip-test-check.yml
permissions:
pull-requests: read
with:
labels: '["CI:bors-skip-client-examples"]'
secrets: inherit
examples:
name: Run all client examples
runs-on: ubuntu-latest
needs: test-skip-check
strategy:
matrix:
client-type:
- rust
- python
- node
# - java
steps:
- name: Dump context
uses: crazy-max/ghaction-dump-context@v2.3.0
- uses: actions/checkout@v4
if: ${{ needs.test-skip-check.outputs.no-skip }}
- uses: actions/checkout@v4
if: ${{ needs.test-skip-check.outputs.no-skip }}
with:
repository: infinyon/fluvio
path: fluvio-repo
- name: Setup K3d
if: ${{ needs.test-skip-check.outputs.no-skip }}
run: curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=${{ env.K3D_VERSION }} bash
- name: Create K3d cluster
if: ${{ needs.test-skip-check.outputs.no-skip }}
run: |
./fluvio-repo/k8-util/cluster/reset-k3d.sh
- name: Sleep 20 to ensure k3d cluster is ready
if: ${{ needs.test-skip-check.outputs.no-skip }}
run: sleep 20
- name: Install Fluvio Local Cluster
if: ${{ needs.test-skip-check.outputs.no-skip }}
uses: infinyon/fluvio@master
with:
cluster-type: local
version: latest
# Ensure cluster is started
- name: Ensure Fluvio Cluster is up
if: ${{ needs.test-skip-check.outputs.no-skip }}
run: |
make cluster-verify
- uses: Swatinem/rust-cache@v2
if: matrix.client-type == 'rust'
- name: Build and test clients
if: ${{ needs.test-skip-check.outputs.no-skip }}
uses: nick-fields/retry@v3.0.0
with:
timeout_minutes: 10
max_attempts: 3
command: |
make run-client-example-${{ matrix.client-type }}
on_retry_command: |
fluvio cluster delete
fluvio cluster start --local --image-version latest
# Job that follows the success of all required jobs in this workflow.
# Used by Bors to detect that all required jobs have completed successfully
done:
name: Pass client examples
if: github.event_name == 'push' && github.ref == 'refs/heads/staging'
needs: examples
runs-on: ubuntu-latest
steps:
- name: Done
run: echo "Done!"