forked from tetratelabs/proxy-wasm-go-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (91 loc) · 2.57 KB
/
workflow.yaml
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
100
101
102
103
104
105
106
107
name: Test
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
TINYGO_VERSION: 0.27.0
jobs:
style:
name: Code style check
runs-on: ubuntu-latest
steps:
- name: install Go
uses: actions/setup-go@v3
with:
go-version: '1.18'
- name: checkout
uses: actions/checkout@v3
- name: run lint
run: make lint
- name: run format check
run: make check
sdk-tests:
name: SDK tests
runs-on: ubuntu-latest
steps:
- name: install Go
uses: actions/setup-go@v3
with:
go-version: '1.18'
- name: checkout
uses: actions/checkout@v3
- name: run tests
run: make test
examples:
name: Examples (${{ matrix.envoy-image }})
strategy:
fail-fast: false
matrix:
envoy-image: [
"envoyproxy/envoy-dev:latest",
"envoyproxy/envoy:v1.21-latest",
"envoyproxy/envoy:v1.22-latest",
"envoyproxy/envoy:v1.23-latest",
"envoyproxy/envoy:v1.24-latest",
"envoyproxy/envoy:v1.25-latest",
"istio/proxyv2:1.14.0",
"istio/proxyv2:1.15.0",
"istio/proxyv2:1.16.0",
"istio/proxyv2:1.17.0",
]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/.cache/tinygo
~/go/pkg/mod
~/go/bin
key: examples-${{ hashFiles('**/go.mod', '**/go.sum') }}-v${{ env.TINYGO_VERSION }}
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.18'
- name: Install TinyGo
run: |
gh release download v${TINYGO_VERSION} -p '*.linux-amd64.tar.gz' -D ~ -R github.com/tinygo-org/tinygo
tar -xf ~/tinygo${TINYGO_VERSION}.linux-amd64.tar.gz -C $HOME
echo "$HOME/tinygo/bin" >> $GITHUB_PATH
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build examples
run: make build.examples
- name: Test examples
run: make test.examples
- name: Install Envoy
run: |
export ENVOY_BIN_DIR=$HOME/envoy/bin
mkdir -p $ENVOY_BIN_DIR
docker run -v $ENVOY_BIN_DIR:/tmp/proxy-wasm-go-sdk -w /tmp/proxy-wasm-go-sdk \
--entrypoint /bin/cp ${{ matrix.envoy-image }} /usr/local/bin/envoy .
echo $ENVOY_BIN_DIR >> $GITHUB_PATH
- name: Run e2e test
run: make test.e2e