11name : Checks
22
33env :
4- DEVNET_SHA : " c6ffb99"
54 CAIRO_LANG_VERSION : " 0.13.1"
5+ DEVNET_VERSION : " 0.0.5"
66
77on :
88 push :
2323 runs-on : ubuntu-latest
2424 steps :
2525
26- - uses : actions/checkout@v3
26+ - uses : actions/checkout@v4
2727
2828 - name : Install poetry
2929 run : |
7171
7272 # ====================== SETUP ====================== #
7373
74- - uses : actions/checkout@v3
75-
74+ - uses : actions/checkout@v4
75+ - uses : asdf-vm/actions/setup@v3
7676 - uses : actions/setup-python@v4
7777 with :
7878 python-version : " 3.12"
8484 pip install poetry
8585 poetry config installer.modern-installation false
8686
87- - name : Install deprecated cairo compiler
88- run : |
89- pip install --upgrade setuptools
90- pip install cairo-lang==${{ env.CAIRO_LANG_VERSION }}
91-
9287 - name : Set up Python ${{ matrix.python-version }}
9388 uses : actions/setup-python@v4
9489 with :
@@ -99,21 +94,54 @@ jobs:
9994 run : |
10095 poetry install
10196
97+ # ====================== CONTRACTS v2 ====================== #
98+ - name : Cache contracts v2
99+ id : cache-contracts_v2
100+ uses : actions/cache@v3
101+ with :
102+ path : starknet_py/tests/e2e/mock/contracts_v2/target
103+ key : ${{ runner.os }}-contracts-${{ hashFiles('starknet_py/tests/e2e/mock/contracts_v2') }}
104+
105+ - name : Compile contracts v2
106+ if : steps.cache-contracts_v2.outputs.cache-hit != 'true'
107+ run : |
108+ poetry run poe compile_contracts v2
109+
110+ # ====================== CONTRACTS v1 ====================== #
111+
112+ - name : Cache contracts v1
113+ id : cache-contracts_v1
114+ uses : actions/cache@v3
115+ with :
116+ path : starknet_py/tests/e2e/mock/contracts_v1/target
117+ key : ${{ runner.os }}-contracts-${{ hashFiles('starknet_py/tests/e2e/mock/contracts_v1') }}
118+
119+ - name : Compile contracts v1
120+ if : steps.cache-contracts_v1.outputs.cache-hit != 'true'
121+ run : |
122+ poetry run poe compile_contracts v1
123+
102124 # ====================== CONTRACTS v0 ====================== #
103125
104- - name : Cache contracts
126+ - name : Cache contracts v0
105127 id : cache-contracts
106128 uses : actions/cache@v3
107129 with :
108130 path : starknet_py/tests/e2e/mock/contracts_compiled
109131 key : ${{ runner.os }}-contracts-${{ hashFiles('starknet_py/tests/e2e/mock/contracts', 'poetry.lock') }}-${{ env.CAIRO_LANG_VERSION }}
110132
111- - name : Compile contracts
133+ - name : Install deprecated cairo compiler
134+ if : steps.cache-contracts.outputs.cache-hit != 'true'
135+ run : |
136+ pip install --upgrade setuptools
137+ pip install cairo-lang==${{ env.CAIRO_LANG_VERSION }}
138+
139+ - name : Compile contracts v0
112140 if : steps.cache-contracts.outputs.cache-hit != 'true'
113141 run : |
114- poetry run poe compile_contracts
142+ poetry run poe compile_contracts v0
115143
116- - name : Upload contracts
144+ - name : Upload contracts v0
117145 uses : actions/upload-artifact@v3
118146 with :
119147 name : contract-artifacts
@@ -132,9 +160,7 @@ jobs:
132160 matrix :
133161 python-version : [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
134162 steps :
135- - uses : actions/checkout@v3
136- - uses : actions-rust-lang/setup-rust-toolchain@v1
137- - uses : Swatinem/rust-cache@v2
163+ - uses : actions/checkout@v4
138164
139165 - name : Download contracts
140166 uses : actions/download-artifact@v3
@@ -168,10 +194,7 @@ jobs:
168194 # ====================== SETUP DEVNET ====================== #
169195
170196 - name : Install devnet
171- run : |
172- cargo install --locked \
173- --git https://github.com/0xSpaceShard/starknet-devnet-rs.git \
174- --rev ${{ env.DEVNET_SHA }}
197+ run : ./starknet_py/tests/install_devnet.sh
175198
176199 # ====================== RUN TESTS ====================== #
177200
@@ -202,16 +225,14 @@ jobs:
202225 strategy :
203226 fail-fast : false
204227 env :
205- GOERLI_INTEGRATION_RPC_URL : ${{ secrets.INTEGRATION_RPC_URL }}
206- GOERLI_TESTNET_RPC_URL : ${{ secrets.TESTNET_RPC_URL }}
207228 SEPOLIA_INTEGRATION_RPC_URL : ${{ secrets.SEPOLIA_INTEGRATION_RPC_URL }}
208- SEPOLIA_TESTNET_RPC_URL : ${{ secrets.SEPOLIA_TESTNET_RPC_URL }}
209- GOERLI_INTEGRATION_ACCOUNT_PRIVATE_KEY : ${{ secrets.INTEGRATION_ACCOUNT_PRIVATE_KEY }}
210- GOERLI_INTEGRATION_ACCOUNT_ADDRESS : ${{ secrets.INTEGRATION_ACCOUNT_ADDRESS }}
211- GOERLI_TESTNET_ACCOUNT_PRIVATE_KEY : ${{ secrets.TESTNET_ACCOUNT_PRIVATE_KEY }}
212- GOERLI_TESTNET_ACCOUNT_ADDRESS : ${{ secrets.TESTNET_ACCOUNT_ADDRESS }}
229+ SEPOLIA_RPC_URL : ${{ secrets.SEPOLIA_RPC_URL }}
230+ SEPOLIA_ACCOUNT_ADDRESS : ${{ secrets.SEPOLIA_ACCOUNT_ADDRESS }}
231+ SEPOLIA_ACCOUNT_PRIVATE_KEY : ${{ secrets.SEPOLIA_ACCOUNT_PRIVATE_KEY }}
232+ SEPOLIA_INTEGRATION_ACCOUNT_PRIVATE_KEY : ${{ secrets.SEPOLIA_INTEGRATION_ACCOUNT_PRIVATE_KEY }}
233+ SEPOLIA_INTEGRATION_ACCOUNT_ADDRESS : ${{ secrets.SEPOLIA_INTEGRATION_ACCOUNT_ADDRESS }}
213234 steps :
214- - uses : actions/checkout@v3
235+ - uses : actions/checkout@v4
215236
216237 - name : Download contracts
217238 uses : actions/download-artifact@v3
@@ -273,9 +294,10 @@ jobs:
273294 matrix :
274295 python-version : [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
275296 steps :
276- - uses : actions/checkout@v3
277- - uses : actions-rust-lang/setup-rust-toolchain@v1
278- - uses : Swatinem/rust-cache@v2
297+ - uses : actions/checkout@v4
298+ - uses : dtolnay/rust-toolchain@dc6353516c68da0f06325f42ad880f76a5e77ec9
299+ with :
300+ toolchain : stable
279301
280302 - name : Download contracts
281303 uses : actions/download-artifact@v3
@@ -291,7 +313,9 @@ jobs:
291313 # ====================== SETUP DEVNET ====================== #
292314
293315 - name : Install devnet
294- run : cargo install --locked --git https://github.com/0xSpaceShard/starknet-devnet-rs.git --rev ${{ env.DEVNET_SHA }}
316+ run : |
317+ $DEVNET_INSTALL_DIR = "$(git rev-parse --show-toplevel)/starknet_py/tests/e2e/devnet"
318+ cargo install starknet-devnet --version ${{ env.DEVNET_VERSION }} --root $DEVNET_INSTALL_DIR
295319
296320 # ====================== SETUP PYTHON ====================== #
297321
@@ -342,9 +366,7 @@ jobs:
342366 matrix :
343367 python-version : [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
344368 steps :
345- - uses : actions/checkout@v3
346- - uses : actions-rust-lang/setup-rust-toolchain@v1
347- - uses : Swatinem/rust-cache@v2
369+ - uses : actions/checkout@v4
348370
349371 - name : Download contracts
350372 uses : actions/download-artifact@v3
@@ -378,10 +400,7 @@ jobs:
378400 # ====================== SETUP DEVNET ====================== #
379401
380402 - name : Install devnet
381- run : |
382- cargo install --locked \
383- --git https://github.com/0xSpaceShard/starknet-devnet-rs.git \
384- --rev ${{ env.DEVNET_SHA }}
403+ run : ./starknet_py/tests/install_devnet.sh
385404
386405 # ====================== RUN TESTS ====================== #
387406
@@ -411,9 +430,10 @@ jobs:
411430 matrix :
412431 python-version : [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
413432 steps :
414- - uses : actions/checkout@v3
415- - uses : actions-rust-lang/setup-rust-toolchain@v1
416- - uses : Swatinem/rust-cache@v2
433+ - uses : actions/checkout@v4
434+ - uses : dtolnay/rust-toolchain@dc6353516c68da0f06325f42ad880f76a5e77ec9
435+ with :
436+ toolchain : stable
417437
418438 - name : Download contracts
419439 uses : actions/download-artifact@v3
@@ -447,7 +467,9 @@ jobs:
447467 # ====================== SETUP DEVNET ====================== #
448468
449469 - name : Install devnet
450- run : cargo install --locked --git https://github.com/0xSpaceShard/starknet-devnet-rs.git --rev ${{ env.DEVNET_SHA }}
470+ run : |
471+ $DEVNET_INSTALL_DIR = "$(git rev-parse --show-toplevel)/starknet_py/tests/e2e/devnet"
472+ cargo install starknet-devnet --version ${{ env.DEVNET_VERSION }} --root $DEVNET_INSTALL_DIR
451473
452474 # ====================== RUN TESTS ====================== #
453475
0 commit comments