Skip to content

Commit 27e8ad9

Browse files
author
devops72-sre
committed
merged master
2 parents db5b8db + 66ca8bb commit 27e8ad9

235 files changed

Lines changed: 16777 additions & 22189 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
TESTNET_ACCOUNT_ADDRESS=
2-
TESTNET_PRIVATE_KEY=
2+
TESTNET_PRIVATE_KEY=

.github/workflows/docker-build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
package:
17-
[pragma-sdk, price-pusher, vrf-listener, checkpointer, merkle-maker]
17+
[pragma-sdk, price-pusher, vrf-listener, checkpointer, lmax-connector]
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v4
@@ -29,7 +29,8 @@ jobs:
2929

3030
- name: Extract package version
3131
run: |
32-
export PACKAGE_VERSION=$(grep 'version = "' ./${{ matrix.package }}/pyproject.toml | grep -m 1 -e '[0-9][0-9a-zA-Z]*[-.a-z0-9]*' -o)
32+
PKG_PATH=$(echo ${{ matrix.package }} | tr '-' '_')
33+
export PACKAGE_VERSION=$(grep -o '".*"' ./${{ matrix.package }}/$PKG_PATH/__init__.py | tr -d '"')
3334
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
3435
echo $PACKAGE_VERSION
3536

.github/workflows/docker-test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Task - Build Docker Image
3+
4+
on:
5+
workflow_dispatch:
6+
workflow_call:
7+
8+
jobs:
9+
build_containers:
10+
strategy:
11+
matrix:
12+
package: [pragma-sdk, price-pusher, vrf-listener, checkpointer, lmax-connector]
13+
runs-on: ubuntu-latest
14+
permissions:
15+
checks: write
16+
contents: write
17+
pull-requests: write
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v2.2.0
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v2.10.0
27+
- name: Extract package version
28+
if: matrix.package == 'pragma-sdk'
29+
run: |
30+
PKG_PATH=$(echo ${{ matrix.package }} | tr '-' '_')
31+
export PACKAGE_VERSION=$(grep -o '".*"' ./${{ matrix.package }}/$PKG_PATH/__init__.py | tr -d '"')
32+
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
33+
echo $PACKAGE_VERSION
34+
- name: Build Docker Image
35+
id: docker_build
36+
uses: docker/build-push-action@v4.2.1
37+
with:
38+
context: .
39+
file: ./${{ matrix.package }}/Dockerfile
40+
build-args: ${{ matrix.package == 'pragma-sdk' && format('PRAGMA_PACKAGE_VERSION={0}', env.PACKAGE_VERSION) || '' }}

.github/workflows/linters.yml

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,29 @@
1-
---
21
name: Task - Lint, Format & Typecheck
32

43
on:
54
workflow_dispatch:
65
workflow_call:
76

87
env:
9-
PYTHON_VERSION: 3.12.4
8+
PYTHON_VERSION: 3.12
109

1110
jobs:
12-
lint-format-typecheck:
13-
continue-on-error: true
11+
lint:
1412
runs-on: ubuntu-latest
1513
strategy:
16-
matrix:
17-
package:
18-
[
19-
pragma-utils,
20-
pragma-sdk,
21-
price-pusher,
22-
vrf-listener,
23-
checkpointer,
24-
merkle-maker,
25-
lp-pricer,
26-
]
2714
fail-fast: false
2815
steps:
29-
- uses: actions/checkout@v3
30-
- uses: CfirTsabari/actions-pipx@v1
31-
- name: Install poetry
32-
run: pipx install poetry
33-
- name: Set up Python 3.12.4
34-
uses: actions/setup-python@v4
16+
- uses: actions/checkout@v4
17+
18+
- uses: astral-sh/setup-uv@v4
3519
with:
36-
python-version: ${{ env.PYTHON_VERSION }}
37-
cache: "poetry"
20+
enable-cache: true
21+
3822
- name: Install dependencies
39-
run: |
40-
cd ${{ matrix.package }}
41-
poetry install
42-
- name: Check poetry.lock
43-
run: |
44-
cd ${{ matrix.package }}
45-
poetry lock --check
46-
- name: Run lint
47-
run: |
48-
cd ${{ matrix.package }}
49-
poetry run poe lint
50-
- name: Run format
51-
run: |
52-
cd ${{ matrix.package }}
53-
poetry run poe format_check
54-
- name: Run typecheck
55-
run: |
56-
cd ${{ matrix.package }}
57-
poetry run poe typecheck
23+
run: uv sync --python ${{ env.PYTHON_VERSION }} --all-extras
24+
25+
- uses: pre-commit/action@v3.0.1
26+
with:
27+
extra_args: --all-files --verbose
28+
env:
29+
SKIP: no-commit-to-branch

.github/workflows/pre-release.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
branches:
77
- master
88

9-
env:
10-
PYTHON_VERSION: 3.12.4
11-
129
defaults:
1310
run:
1411
working-directory: pragma-sdk
@@ -17,17 +14,23 @@ jobs:
1714
test_pypi_publish:
1815
name: Upload package to Test PyPI
1916
runs-on: ubuntu-latest
17+
18+
# Use Permissions to access the repository
19+
permissions:
20+
id-token: write
21+
2022
steps:
2123
- uses: actions/checkout@v4
22-
- uses: CfirTsabari/actions-pipx@v1
23-
- name: Install poetry
24-
run: pipx install poetry
25-
- uses: actions/setup-python@v5
24+
25+
- uses: astral-sh/setup-uv@v4
26+
with:
27+
enable-cache: true
28+
29+
- run: uv build
30+
31+
- name: Upload package to PyPI
32+
uses: pypa/gh-action-pypi-publish@release/v1
2633
with:
27-
python-version: ${{ env.PYTHON_VERSION }}
28-
cache: "poetry"
29-
- run: pipx inject poetry poetry-monorepo-dependency-plugin
30-
- run: poetry config repositories.test-pypi https://test.pypi.org/legacy/
31-
- run: poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_API_TOKEN }}
32-
- run: poetry build -f sdist
33-
- run: poetry publish -r test-pypi --skip-existing
34+
packages-dir: pragma-sdk/dist
35+
repository-url: https://test.pypi.org/legacy/
36+
skip-existing: true

.github/workflows/publish.yml

Lines changed: 22 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,70 +8,33 @@ defaults:
88
run:
99
working-directory: pragma-sdk
1010

11-
env:
12-
PYTHON_VERSION: 3.12.4
13-
1411
jobs:
15-
bump_version:
12+
release:
13+
name: Pypi Publish
1614
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@v3
19-
with:
20-
fetch-depth: 0
21-
- name: Set up Python
22-
uses: actions/setup-python@v4
23-
with:
24-
python-version: ${{ env.PYTHON_VERSION }}
25-
- name: Install Commitizen
26-
run: pip install --upgrade Commitizen
27-
- name: Configure Git
28-
run: |
29-
git config user.name github-actions
30-
git config user.email github-actions@github.com
31-
- name: Bump version
32-
run: |
33-
git fetch --tags
34-
cz bump --retry || echo "probably nothing to do"
35-
- name: Push changes
36-
run: |
37-
TAG=$(git tag --points-at HEAD)
38-
if [[ $TAG ]]; then
39-
echo "Version bumped to $TAG"
40-
git push
41-
git push --tags
42-
else
43-
echo "Version NOT bumped"
44-
fi
4515

46-
pypi_publish:
47-
needs: [bump_version]
48-
name: Upload package to PyPI
49-
runs-on: ubuntu-latest
16+
# Use Permissions to access the repository
17+
permissions:
18+
id-token: write
19+
5020
steps:
5121
- uses: actions/checkout@v4
52-
- uses: CfirTsabari/actions-pipx@v1
53-
- name: Install poetry
54-
run: pipx install poetry
55-
- uses: actions/setup-python@v5
22+
23+
- uses: astral-sh/setup-uv@v4
5624
with:
57-
python-version: ${{ env.PYTHON_VERSION }}
58-
cache: "poetry"
59-
- run: pipx inject poetry poetry-monorepo-dependency-plugin
60-
- run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}"
61-
- run: poetry build -f sdist
62-
- run: poetry publish --skip-existing
25+
enable-cache: true
6326

64-
update_lock:
65-
needs: [pypi_publish]
66-
name: Update lock file
67-
runs-on: ubuntu-latest
68-
steps:
69-
- uses: actions/checkout@v4
70-
- uses: CfirTsabari/actions-pipx@v1
71-
- name: Install poetry
72-
run: pipx install poetry
73-
- uses: actions/setup-python@v5
27+
- name: check GITHUB_REF matches package version
28+
uses: samuelcolvin/check-python-version@v4.1
29+
with:
30+
version_file_path: pragma-sdk/pragma_sdk/__init__.py
31+
32+
- run: uv build
33+
34+
- name: Publish to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1
7436
with:
75-
python-version: ${{ env.PYTHON_VERSION }}
76-
cache: "poetry"
77-
- run: sh scripts/poetry_lock_update.sh
37+
packages-dir: pragma-sdk/dist
38+
attestations: false
39+
password: ${{ secrets.PYPI_API_KEY }}
40+
skip-existing: true

.github/workflows/pull-request.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ jobs:
2020
tests:
2121
name: Build & Integration Tests
2222
uses: ./.github/workflows/tests.yml
23+
24+
build_containers:
25+
name: Build Docker Image
26+
uses: ./.github/workflows/docker-test.yml

.github/workflows/tests.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_call:
77

88
env:
9-
PYTHON_VERSION: 3.12.4
9+
PYTHON_VERSION: 3.12
1010

1111
jobs:
1212
tests:
@@ -21,32 +21,27 @@ jobs:
2121
price-pusher,
2222
vrf-listener,
2323
checkpointer,
24-
merkle-maker,
2524
lp-pricer,
2625
]
2726
fail-fast: false
2827
steps:
29-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
3029
with:
3130
submodules: "true"
32-
- uses: CfirTsabari/actions-pipx@v1
33-
- name: Install poetry
34-
run: pipx install poetry
35-
- uses: actions/setup-python@v4
31+
- uses: astral-sh/setup-uv@v4
3632
with:
37-
python-version: ${{ env.PYTHON_VERSION }}
38-
cache: "poetry"
33+
enable-cache: true
3934
- name: Install dependencies
4035
run: |
4136
cd ${{ matrix.package }}
42-
poetry install
37+
uv sync --python ${{ env.PYTHON_VERSION }} --all-extras
4338
4439
- name: Cache contracts
4540
id: cache-contracts
4641
uses: actions/cache@v3
4742
with:
4843
path: ./pragma-oracle/pragma-oracle/target
49-
key: ${{ runner.os }}-contracts-${{ hashFiles('./pragma-oracle/pragma-oracle/src', 'poetry.lock') }}
44+
key: ${{ runner.os }}-contracts-${{ hashFiles('./pragma-oracle/pragma-oracle/src') }}
5045

5146
- uses: software-mansion/setup-scarb@v1
5247
with:
@@ -66,7 +61,7 @@ jobs:
6661
# Extract the relative path of the file for comparison
6762
rel_path=${file#./pragma-oracle/pragma-oracle/target/dev}
6863
# Use diff to compare the file with its counterpart in the SDK directory
69-
diff "$file" "pragma-sdk/pragma_sdk/onchain/abis$rel_path" || (echo "Error: $rel_path in pragma-oracle/target does not match with pragma-sdk/pragma_sdk/onchain/abis/" && exit 1)
64+
diff "$file" "pragma-sdk/pragma_sdk/onchain/abis$rel_path" || (echo "Error: $rel_path in pragma-oracle/target does not match with pragma-sdk/pragma_sdk/onchain/abis/" && exit 1)
7065
done
7166
- name: Install rust
7267
run: |
@@ -87,19 +82,19 @@ jobs:
8782
# See: https://github.com/astraly-labs/pragma-sdk/issues/153
8883
cd ${{ matrix.package }}
8984
if [ "${{ matrix.package }}" = "pragma-sdk" ]; then
90-
poetry run poe test_client
91-
poetry run poe test_vrf
92-
poetry run poe test_fetchers
93-
poetry run poe test_merkle_feed
94-
poetry run poe test_unit
95-
poetry run poe test_update_client
85+
uv run poe test_client
86+
uv run poe test_vrf
87+
uv run poe test_fetchers
88+
uv run poe test_merkle_feed
89+
uv run poe test_unit
90+
uv run poe test_update_client
9691
else
97-
poetry run poe test
92+
uv run poe test
9893
fi
9994
- name: Generate coverage in XML
10095
run: |
10196
cd ${{ matrix.package }}
102-
poetry run coverage xml
97+
uv run coverage xml
10398
- name: Upload coverage to Codecov
10499
uses: codecov/codecov-action@v3
105100
env:

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,8 @@ devnet.pkl
7272

7373
# Mac
7474
.DS_STORE
75+
76+
# Lmax connector metadata
77+
lmax-connector/log/
78+
lmax-connector/store/
79+
lmax-connector/config/fix_settings.cfg

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "pragma-oracle"]
22
path = pragma-oracle
3-
url = https://github.com/Astraly-Labs/pragma-oracle.git
3+
url = https://github.com/Astraly-Labs/pragma-oracle.git

0 commit comments

Comments
 (0)