Skip to content

Commit 3dfaa0d

Browse files
authored
ci: add installation test after publishing package (#62)
As a sanity check after publishing a LuaRock module, it'd be good to `luarocks install` it on a fresh runner to test that it actually worked.
1 parent 694fb24 commit 3dfaa0d

File tree

4 files changed

+101
-6
lines changed

4 files changed

+101
-6
lines changed

.github/actions/install-cpp-sdk-redis/action.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
# This custom action is used because the MarkusJx/install-boost does
2-
# not include all built libraries for mac or windows builds.
3-
# Specifically, it was missing boost_json.
41
name: Install C++ Server-side SDK with Redis Source
52
description: 'Obtain prebuilt libraries for the Launchdarkly C++ server-side SDK with Redis Source.'
63
inputs:
74
version:
85
required: true
96
description: "Version of the C++ SDK with Redis Source."
10-
default: "v1.0.1"
7+
default: "launchdarkly-cpp-server-redis-source-v2.1.0"
118
path:
129
description: "Where to download the SDK."
1310
default: "cpp-sdk"

.github/actions/rockspec-names/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ outputs:
77
server_redis:
88
description: "The name of the redis rockspec package."
99
value: ${{ steps.pkg-name.outputs.server_redis }}
10+
server_version:
11+
description: "The version of the server rockspec package."
12+
value: ${{ steps.pkg-name.outputs.server_version }}
13+
server_redis_version:
14+
description: "The version of the redis rockspec package."
15+
value: ${{ steps.pkg-name.outputs.server_redis_version }}
1016

1117
runs:
1218
using: composite
@@ -20,3 +26,5 @@ runs:
2026
run: |
2127
echo "server=launchdarkly-server-sdk-${{ env.LUA_SERVER_VERSION }}-0.rockspec" >> $GITHUB_OUTPUT
2228
echo "server_redis=launchdarkly-server-sdk-redis-${{ env.LUA_SERVER_REDIS_VERSION }}-0.rockspec" >> $GITHUB_OUTPUT
29+
echo "server_version=${{ env.LUA_SERVER_VERSION }}" >> $GITHUB_OUTPUT
30+
echo "server_redis_version=${{ env.LUA_SERVER_REDIS_VERSION }}" >> $GITHUB_OUTPUT
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: 'Install Lua SDK'
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
package:
6+
description: 'Package to install.'
7+
required: false
8+
type: choice
9+
options:
10+
- 'launchdarkly-server-sdk'
11+
- 'launchdarkly-server-sdk-redis'
12+
default: 'launchdarkly-server-sdk'
13+
version:
14+
description: 'Version to install. Default is latest.'
15+
required: false
16+
type: string
17+
18+
lua-version:
19+
description: 'Lua version.'
20+
required: false
21+
type: choice
22+
options:
23+
- '5.1'
24+
- '5.2'
25+
- '5.3'
26+
- '5.4'
27+
- 'luajit-2.0.5'
28+
default: '5.4'
29+
cpp-sdk-version:
30+
description: "Version of the C++ Server-side SDK to use for building and testing."
31+
required: false
32+
type: string
33+
default: 'launchdarkly-cpp-server-redis-source-v2.1.0'
34+
35+
jobs:
36+
install:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Install Lua
41+
uses: leafo/gh-actions-lua@35bcb06abec04ec87df82e08caa84d545348536e
42+
with:
43+
luaVersion: ${{ inputs.lua-version }}
44+
45+
- name: Install LuaRocks
46+
uses: leafo/gh-actions-luarocks@e65774a6386cb4f24e293dca7fc4ff89165b64c5
47+
48+
- name: Install Boost
49+
id: install-boost
50+
uses: MarkusJx/install-boost@v2.4.4
51+
with:
52+
boost_version: 1.81.0
53+
platform_version: "22.04"
54+
55+
- name: Install CPP SDK
56+
uses: ./.github/actions/install-cpp-sdk-redis
57+
with:
58+
version: ${{ inputs.cpp-sdk-version }}
59+
path: cpp-sdk
60+
61+
- name: Install Package
62+
shell: bash
63+
env:
64+
CPP_PATH: $GITHUB_WORKSPACE/cpp-sdk/build-dynamic/release
65+
run: |
66+
luarocks install ${{ inputs.package }} ${{ inputs.version }} \
67+
LD_DIR=$CPP_PATH \
68+
LDREDIS_DIR=$CPP_PATH
69+
70+
- name: Remove Package
71+
shell: bash
72+
run: luarocks remove ${{ inputs.package }}

.github/workflows/manual-publish.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
id: rockspecs
4949

5050
- uses: ./.github/actions/publish
51-
name: "Publish Lua Server SDK"
51+
name: ${{ format('Publish launchdarkly-server-sdk @ {0}', steps.rockspecs.outputs.server_version) }}
5252
if: ${{ inputs.rockspec == 'server' || inputs.rockspec == 'both' }}
5353
with:
5454
dry_run: ${{ inputs.dry_run }}
@@ -57,10 +57,28 @@ jobs:
5757
force: ${{ inputs.force }}
5858

5959
- uses: ./.github/actions/publish
60-
name: "Publish Lua Server SDK's Redis Integration"
60+
name: ${{ format('Publish launchdarkly-server-sdk-redis @ {0}', steps.rockspecs.outputs.server_redis_version) }}
6161
if: ${{ inputs.rockspec == 'redis' || inputs.rockspec == 'both'}}
6262
with:
6363
dry_run: ${{ inputs.dry_run }}
6464
rockspec: ${{ steps.rockspecs.outputs.server_redis }}
6565
skip_pack: ${{ inputs.skip_pack }}
6666
force: ${{ inputs.force }}
67+
68+
install-server-sdk:
69+
name: ${{ format('Install launchdarkly-server-sdk @ {0}', steps.rockspecs.outputs.server_version) }}
70+
needs: build-publish
71+
if: ${{ inputs.rockspec == 'server' || inputs.rockspec == 'both' }}
72+
uses: ./github/workflows/install-lua-sdk.yml
73+
with:
74+
package: launchdarkly-server-sdk
75+
version: ${{ steps.rockspecs.outputs.server_version }}
76+
77+
install-server-redis:
78+
name: ${{ format('Install launchdarkly-server-sdk-redis @ {0}', steps.rockspecs.outputs.server_redis_version) }}
79+
needs: build-publish
80+
if: ${{ inputs.rockspec == 'redis' || inputs.rockspec == 'both' }}
81+
uses: ./github/workflows/install-lua-sdk.yml
82+
with:
83+
package: launchdarkly-server-sdk-redis
84+
version: ${{ steps.rockspecs.outputs.server_redis_version }}

0 commit comments

Comments
 (0)