-
Notifications
You must be signed in to change notification settings - Fork 16
104 lines (89 loc) · 3.22 KB
/
checks.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Checks
on:
pull_request:
push:
branches:
- main
jobs:
test_and_lint:
strategy:
matrix:
os: [
"macos-latest",
"ubuntu-20.04"
]
runs-on: ${{ matrix.os }}
env:
DEVNET_SHA: 1bd447d8ac8c2fb0a3eaf2d54512671f4a16c7ba
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@4f73d30c2fc44a9466a3ed890fb8db7a7b554302
with:
cmake-version: '3.16.x'
- name: Setup Python
uses: actions/setup-python@v4.5.0
with:
python-version: 3.9.12
cache: 'pip'
- name: Install cairo-lang
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# TODO: Replace with installing release when release is available
- name: Clone starknet-devnet-rs
run: |
git clone https://github.com/0xSpaceShard/starknet-devnet-rs.git starknet-devnet-rs
pushd ${{ github.workspace }}/starknet-devnet-rs
git checkout ${{ env.DEVNET_SHA }}
popd
- name: Cache devnet build
uses: actions/cache@v3
with:
path: starknet-devnet-rs/target/release
key: ${{ runner.os }}-starknet-devnet-rs-target-release-${{ env.DEVNET_SHA }}
- name: Build devnet
run: |
if [[ ! -d ${{ github.workspace }}/starknet-devnet-rs/target/release ]]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
pushd ${{ github.workspace }}/starknet-devnet-rs
cargo build --release
popd
else
echo "Found existing starknet-devnet-rs build, skipping compilation."
fi
- name: Setup asdf
uses: asdf-vm/actions/setup@v2
- name: Install sncast 0.6.0
run: |
asdf plugin add starknet-foundry
asdf install starknet-foundry 0.6.0
asdf global starknet-foundry 0.6.0
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Lint
run: ./gradlew :lib:lintKotlin
- name: Run tests and generate coverage report
env:
DEVNET_PATH: ${{ github.workspace }}/starknet-devnet-rs/target/release/starknet-devnet
NETWORK_TEST_MODE: "disabled"
NETWORK_TEST_NETWORK_NAME: "TESTNET"
GOERLI_TESTNET_RPC_URL: ${{ secrets.TESTNET_RPC_URL }}
GOERLI_TESTNET_ACCOUNT_ADDRESS: ${{ secrets.TESTNET_ACCOUNT_ADDRESS }}
GOERLI_TESTNET_PRIVATE_KEY: ${{ secrets.TESTNET_PRIVATE_KEY }}
GOERLI_TESTNET_CONST_NONCE_ACCOUNT_ADDRESS: ${{ secrets.TESTNET_CONST_NONCE_ACCOUNT_ADDRESS }}
GOERLI_TESTNET_CONST_NONCE_PRIVATE_KEY: ${{ secrets.TESTNET_CONST_NONCE_PRIVATE_KEY }}
run: ./gradlew :lib:koverXmlReport --info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
files: lib/build/reports/kover/report.xml