Skip to content

Commit a7e4c1a

Browse files
authored
ci: Migrate from circleci to GH actions (#3)
1 parent ecf9e2d commit a7e4c1a

File tree

4 files changed

+41
-52
lines changed

4 files changed

+41
-52
lines changed

.circleci/config.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and run
2+
on:
3+
push:
4+
branches: [ main ]
5+
paths-ignore:
6+
- '**.md' # Do not need to run CI for markdown changes.
7+
pull_request:
8+
branches: [ main ]
9+
paths-ignore:
10+
- '**.md'
11+
12+
jobs:
13+
build-and-run:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
id-token: write # Needed if using OIDC to get release secrets.
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: 3.8
26+
27+
- name: Install poetry
28+
run: pipx install poetry
29+
30+
- name: Install dependencies
31+
run: poetry install
32+
33+
- uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v1.0.0
34+
with:
35+
use_server_key: true
36+
role_arn: ${{ vars.AWS_ROLE_ARN }}
37+
command: poetry run python main.py

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# LaunchDarkly Sample OpenFeature Python Server application
22

3-
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/launchdarkly/hello-openfeature-python-server/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/launchdarkly/hello-openfeature-python-server/tree/main)
3+
[![Build and run](https://github.com/launchdarkly/hello-openfeature-python-server/actions/workflows/ci.yml/badge.svg)](https://github.com/launchdarkly/hello-openfeature-python-server/actions/workflows/ci.yml)
44

55
We've built a simple console script that demonstrates how LaunchDarkly's OpenFeature provider works.
66

77
## Build instructions
88

99
1. Install the project dependencies by running `poetry install`
10-
2. Set the environment variable `LAUNCHDARKLY_SERVER_SDK` to your LaunchDarkly SDK key.
10+
2. Set the environment variable `LAUNCHDARKLY_SERVER_KEY` to your LaunchDarkly SDK key.
1111
3. Set the environment variable `LAUNCHDARKLY_FLAG_KEY` to the LaunchDarkly boolean flag key you wish to evaluate.
1212
4. Run `poetry run python main.py`.
1313

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
from ld_openfeature import LaunchDarklyProvider
55
from os import getenv
66

7-
sdk_key = getenv("LAUNCHDARKLY_SERVER_SDK", "")
7+
sdk_key = getenv("LAUNCHDARKLY_SERVER_KEY", "")
88
flag_key = getenv("LAUNCHDARKLY_FLAG_KEY", "")
99

1010
if sdk_key == "":
11-
print("*** Set the 'LAUNCHDARKLY_SERVER_SDK' environment variable before running this script")
11+
print("*** Set the 'LAUNCHDARKLY_SERVER_KEY' environment variable before running this script")
1212
exit(1)
1313
elif flag_key == "":
1414
print("*** Set the 'LAUNCHDARKLY_FLAG_KEY' environment variable before running this script")

0 commit comments

Comments
 (0)