feat: Add propeller swap encoders

- Add setup for package
- Add docs
- Add balancer implementation and test
- Add CI:
  - Add setup action
  - Add test and format CI
- Add CD: Publish python package to AWS
This commit is contained in:
Diana Carvalho
2024-08-29 13:11:07 +01:00
parent e4967b1880
commit 41f20f14b0
13 changed files with 318 additions and 3 deletions

View File

@@ -0,0 +1,29 @@
name: Publish Propeller Swap Encoders Python Packages to AWS CodeArtifact
on:
release:
types:
- prereleased
- released
workflow_dispatch: { }
permissions:
id-token: write
contents: read
jobs:
publish_propeller_solver_core:
uses: propeller-heads/ci-cd-templates/.github/workflows/release-python-package.yaml@main
permissions:
id-token: write
contents: read
with:
package_root: "propeller-solver-core"
publish_propeller_swap_encoders:
uses: propeller-heads/ci-cd-templates/.github/workflows/release-python-package.yaml@main
permissions:
id-token: write
contents: read
with:
package_root: "propeller-swap-encoders"

32
.github/workflows/python-tests.yaml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Test code using pytest
on:
workflow_call:
inputs:
runs_on:
required: false
type: string
default: ubuntu-latest
timeout_minutes:
required: false
type: number
default: 15
jobs:
test-python:
runs-on: "${{ inputs.runs_on }}"
timeout-minutes: "${{ inputs.timeout_minutes }}"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Env
uses: ./.github/actions/setup_env
- name: Test with pytest
id: tests
run: |
export PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE/propeller-swap-encoders
pytest --disable-warnings ./propeller-swap-encoders

32
.github/workflows/swap-encoders.yaml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Swap encoders CI
on:
pull_request:
permissions:
id-token: write
contents: read
env:
PYTEST_ADDOPTS: "--color=yes"
jobs:
tests:
uses: propeller-heads/propeller-protocol-lib/.github/workflows/python-tests.yaml@dc/ENG-3545-make-encoders-lib
formatting:
name: Formatting
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Env
uses: ./.github/actions/setup_env
- name: Black Formatting
run: |
black ./propeller-swap-encoders --check --skip-magic-trailing-comma