-
Notifications
You must be signed in to change notification settings - Fork 25
90 lines (78 loc) · 2.71 KB
/
Copy pathv2-ci.yaml
File metadata and controls
90 lines (78 loc) · 2.71 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
# v2 is now part of the main aptos-sdk package.
# This workflow validates the v2 subpackage can be imported and its
# standalone test suite (under v2/tests/) still passes.
name: "V2 SDK CI"
permissions:
contents: read
on:
pull_request:
paths:
- "aptos_sdk/v2/**"
- "v2/**"
push:
branches:
- main
paths:
- "aptos_sdk/v2/**"
- "v2/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-v2-standalone:
name: V2 standalone tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13"]
defaults:
run:
working-directory: v2
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
persist-credentials: false
- uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081
with:
enable-cache: true
cache-dependency-glob: "v2/uv.lock"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: ${{ matrix.python-version }}
- name: Setup AikidoSec Safe Chain
uses: aptos-labs/actions/aikidosec-safe-chain@528ef7ad9427a8c0720ea3eea790a9190d6e377d
- name: Install dependencies
run: uv sync --extra dev
- name: Run v2 standalone tests
run: uv run pytest tests/unit --cov=aptos_sdk_v2 --cov-report=term-missing --cov-report=xml:coverage.xml
- name: Upload to Codecov
if: always()
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe
with:
files: v2/coverage.xml
flags: v2-sdk
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
test-v2-integrated:
name: V2 integrated import test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
persist-credentials: false
- uses: ./.github/actions/python-setup
with:
pyproject_directory: .
- name: Verify v2 imports from main package
run: |
uv run python -c "
from aptos_sdk.v2 import Account, Aptos, AptosConfig, Network
from aptos_sdk.v2.bcs import Serializer, Deserializer
from aptos_sdk.v2.crypto.ed25519 import Ed25519PrivateKey
from aptos_sdk.v2.crypto.secp256k1 import Secp256k1PrivateKey
from aptos_sdk.v2.transactions import EntryFunction, TransactionPayload
from aptos_sdk.v2.types import AccountAddress, TypeTag, StructTag
print('All v2 imports OK')
"