-
Notifications
You must be signed in to change notification settings - Fork 5
113 lines (103 loc) · 3.48 KB
/
ci.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Run CI
on:
push:
branches: [ main ]
paths-ignore:
- '**.md' # Do not need to run CI for markdown changes.
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
jobs:
rockspec-info:
uses: ./.github/workflows/rockspec-info.yml
rockspecs:
needs: rockspec-info
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
data=$(echo '${{ needs.rockspec-info.outputs.info }}' | jq -c 'to_entries | map(.value.rockspec)')
echo "matrix=$data" >> $GITHUB_OUTPUT
linux-build:
needs: rockspecs
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
version: ["5.1", "5.2", "5.3", "luajit-2.0.5"]
package: ${{ fromJSON(needs.rockspecs.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/ci
with:
lua-version: ${{ matrix.version }}
rockspec: ${{ matrix.package }}
aws-arn: ${{ vars.AWS_ROLE_ARN_EXAMPLES }}
web-server-examples:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
name: ["hello-haproxy", "hello-nginx"]
steps:
- uses: actions/checkout@v4
- name: Get C++ Versions
id: cpp-versions
uses: ./.github/actions/cpp-versions
- name: Build ${{ matrix.name }} image
run: |
docker build \
--build-arg="CPP_SDK_VERSION=${{ steps.cpp-versions.outputs.sdk }}" \
-t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile .
- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Verify ${{ matrix.name}} example output'
with:
use_server_key: true
role_arn: ${{ vars.AWS_ROLE_ARN_EXAMPLES }}
command: |
docker run -dit --rm --name ${{ matrix.name }} -p 8123:80 \
--env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \
--env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \
launchdarkly:${{ matrix.name }}
curl --retry 5 --retry-all-errors --retry-delay 1 -s -v http://localhost:8123
- name: Stop ${{ matrix.name }} container
run: |
docker stop ${{ matrix.name }}
plain-lua-examples:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
name: [ "hello-debian"]
steps:
- uses: actions/checkout@v4
- name: Get C++ Versions
id: cpp-versions
uses: ./.github/actions/cpp-versions
- name: Build ${{ matrix.name }} image
run: |
docker build \
--build-arg="CPP_SDK_VERSION=${{ steps.cpp-versions.outputs.sdk }}" \
-t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile .
- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Verify ${{ matrix.name}} example output'
with:
use_server_key: true
role_arn: ${{ vars.AWS_ROLE_ARN_EXAMPLES }}
command: |
docker run \
--env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \
--env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \
launchdarkly:${{ matrix.name }}