Repository navigation
97 lines (92 loc) · 3.99 KB
/
Copy pathserver-node.yml
File metadata and controls
97 lines (92 loc) · 3.99 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: sdk/server-node
on:
push:
branches: [main, 'feat/**']
paths-ignore:
- '**.md' #Do not need to run CI for markdown changes.
pull_request:
branches: [main, 'feat/**']
paths-ignore:
- '**.md'
jobs:
build-test-server-node:
runs-on: ubuntu-latest
strategy:
matrix:
# Node versions to run on.
version: [22, 24]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./actions/setup-yarn
with:
node-version: ${{ matrix.version }}
registry-url: 'https://registry.npmjs.org'
- id: shared
name: Shared CI Steps
uses: ./actions/ci
with:
workspace_name: '@launchdarkly/node-server-sdk'
workspace_path: packages/sdk/server-node
- name: Install contract test service dependencies
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: '1'
run: yarn workspace @launchdarkly/node-server-sdk-contract-tests install --no-immutable
- name: Build shared contract test utils (server)
run: yarn workspace @launchdarkly/js-contract-test-utils build:server
- name: Start persistent stores
uses: launchdarkly/gh-actions/actions/persistent-stores@persistent-stores-v0
with:
redis: true
dynamodb: true
- name: Build the redis store used by the test service
run: yarn workspace @launchdarkly/node-server-sdk-redis build
- name: Build the DynamoDB store used by the test service
run: yarn workspace @launchdarkly/node-server-sdk-dynamodb build
- name: Build the test service
run: yarn workspace @launchdarkly/node-server-sdk-contract-tests build
- name: Launch the test service in the background
# The service moves to port 8001 because the test harness expects
# local DynamoDB on port 8000.
env:
PORT: '8001'
run: yarn workspace @launchdarkly/node-server-sdk-contract-tests start 2>&1 &
- name: Run contract tests (v2)
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
with:
test_service_port: 8001
token: ${{ secrets.GITHUB_TOKEN }}
stop_service: 'false'
extra_params: '--skip-from=./packages/sdk/server-node/contract-tests/testharness-suppressions.txt'
- name: Run contract tests (v3)
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
with:
test_service_port: 8001
token: ${{ secrets.GITHUB_TOKEN }}
version: v3
extra_params: '--skip-from=./packages/sdk/server-node/contract-tests/testharness-suppressions-fdv2.txt'
run-custom-socks-proxy-example:
# Fork PRs cannot use OIDC to get the e2e SDK keys. Skip this job for them.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./actions/setup-yarn
with:
node-version: 22
# Installs and starts Dante directly on the runner rather than in a container - see
# proxy/setup.sh.
- name: Install and start Dante (SOCKS proxy)
run: sudo packages/sdk/server-node/examples/features/custom-socks-proxy/proxy/setup.sh
- name: Verify Dante actually started
run: test -f /var/run/danted.pid
- uses: ./actions/run-example
with:
workspace_name: '@launchdarkly/node-server-sdk-example-custom-socks-proxy'
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
env_vars: |
SOCKS_PROXY_URL=socks5h://127.0.0.1:1080
- name: Verify traffic flowed through the SOCKS proxy
run: |
sudo cat /var/log/danted.log | grep -c "tcp/connect \[" | awk '{ if ($1 < 2) { print "FAIL: expected at least 2 SOCKS connections, got " $1; exit 1 } else { print "OK: proxy logged " $1 " connection(s)" } }'