-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
238 additions
and
3,342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Build Documentation | ||
description: 'Build Documentation.' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Build Documentation | ||
shell: bash | ||
run: make docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Build distribution files | ||
description: 'Build distribution files' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Build distribution files | ||
shell: bash | ||
run: poetry build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,15 +17,22 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: 'Get PyPI token' | ||
with: | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN' | ||
|
||
- id: publish | ||
name: Publish Package | ||
uses: ./.github/actions/publish | ||
- uses: ./.github/actions/build | ||
|
||
- uses: ./.github/actions/publish | ||
with: | ||
token: ${{env.PYPI_AUTH_TOKEN}} | ||
dry_run: ${{ inputs.dry_run }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,16 +24,29 @@ jobs: | |
with: | ||
fetch-depth: 0 # If you only need the current version keep this. | ||
|
||
- uses: actions/setup-python@v4 | ||
if: ${{ steps.release.outputs.releases_created }} | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install poetry | ||
if: ${{ steps.release.outputs.releases_created }} | ||
run: pipx install poetry | ||
|
||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
if: ${{ steps.release.outputs.releases_created }} | ||
name: 'Get PyPI token' | ||
with: | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN' | ||
|
||
- id: publish | ||
name: Publish Package | ||
uses: ./.github/actions/publish | ||
- uses: ./.github/actions/build | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- uses: ./.github/actions/build-docs | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- uses: ./.github/actions/publish | ||
if: ${{ steps.release.outputs.releases_created }} | ||
with: | ||
token: ${{env.PYPI_AUTH_TOKEN}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,72 @@ | ||
|
||
PYTEST_FLAGS=-W error::SyntaxWarning | ||
|
||
test: | ||
LD_SKIP_DATABASE_TESTS=1 pytest $(PYTEST_FLAGS) | ||
|
||
test-all: | ||
pytest $(PYTEST_FLAGS) | ||
|
||
lint: | ||
mypy --install-types --non-interactive --config-file mypy.ini ldclient testing | ||
|
||
docs: | ||
cd docs && make html | ||
|
||
.PHONY: test test-all lint docs | ||
|
||
|
||
TEMP_TEST_OUTPUT=/tmp/contract-test-service.log | ||
|
||
# TEST_HARNESS_PARAMS can be set to add -skip parameters for any contract tests that cannot yet pass | ||
# TEST_HARNESS_PARAMS := $(TEST_HARNESS_PARAMS) \ | ||
|
||
SPHINXOPTS = -W --keep-going | ||
SPHINXBUILD = sphinx-build | ||
SPHINXPROJ = launchdarkly-server-sdk | ||
SOURCEDIR = docs | ||
BUILDDIR = $(SOURCEDIR)/build | ||
# port 8000 is already used in the CI environment because we're running a DynamoDB container | ||
PORT=10000 | ||
|
||
build-contract-tests: | ||
@cd contract-tests && pip install -r requirements.txt | ||
|
||
PORT=9000 | ||
|
||
.PHONY: help | ||
help: #! Show this help message | ||
@echo 'Usage: make [target] ... ' | ||
@echo '' | ||
@echo 'Targets:' | ||
@grep -h -F '#!' $(MAKEFILE_LIST) | grep -v grep | sed 's/:.*#!/:/' | column -t -s":" | ||
|
||
.PHONY: install | ||
install: | ||
@poetry install --all-extras | ||
|
||
# | ||
# Quality control checks | ||
# | ||
|
||
.PHONY: test | ||
test: #! Run unit tests | ||
test: install | ||
@poetry run pytest $(PYTEST_FLAGS) | ||
|
||
.PHONY: lint | ||
lint: #! Run type analysis and linting checks | ||
lint: install | ||
@poetry run mypy ldclient testing | ||
|
||
# | ||
# Documentation generation | ||
# | ||
|
||
.PHONY: docs | ||
docs: #! Generate sphinx-based documentation | ||
@poetry install --with docs | ||
@cd docs | ||
@poetry run $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
# | ||
# Contract test service commands | ||
# | ||
|
||
.PHONY: install-contract-tests-deps | ||
install-contract-tests-deps: | ||
poetry install --with contract-tests | ||
|
||
.PHONY: start-contract-test-service | ||
start-contract-test-service: | ||
@cd contract-tests && python service.py $(PORT) | ||
@cd contract-tests && poetry run python service.py $(PORT) | ||
|
||
.PHONY: start-contract-test-service-bg | ||
start-contract-test-service-bg: | ||
@echo "Test service output will be captured in $(TEMP_TEST_OUTPUT)" | ||
@make start-contract-test-service >$(TEMP_TEST_OUTPUT) 2>&1 & | ||
|
||
.PHONY: run-contract-tests | ||
run-contract-tests: | ||
curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/v2/downloader/run.sh \ | ||
| VERSION=v2 PARAMS="-url http://localhost:$(PORT) -debug -stop-service-at-end $(TEST_HARNESS_PARAMS)" sh | ||
|
||
contract-tests: build-contract-tests start-contract-test-service-bg run-contract-tests | ||
@curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/v2/downloader/run.sh \ | ||
| VERSION=v2 PARAMS="-url http://localhost:$(PORT) -debug -stop-service-at-end" sh | ||
|
||
.PHONY: build-contract-tests start-contract-test-service run-contract-tests contract-tests | ||
.PHONY: contract-tests | ||
contract-tests: #! Run the contract test harness | ||
contract-tests: install-contract-tests-deps start-contract-test-service-bg run-contract-tests |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.