-
Notifications
You must be signed in to change notification settings - Fork 28
136 lines (120 loc) · 4.46 KB
/
papyrus_ci.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Papyrus-CI
on:
pull_request:
types:
- opened
- reopened
- synchronize
- auto_merge_enabled
- edited # for when the PR title is edited
paths:
- '.github/workflows/papyrus_ci.yml'
- 'Dockerfile'
- 'papyrus_utilities.Dockerfile'
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/papyrus**/**'
- 'crates/sequencing/**'
- 'crates/starknet_client/**'
- 'scripts/dependencies.sh'
merge_group:
types: [checks_requested]
env:
RUSTFLAGS: "-D warnings"
# On PR events, cancel existing CI runs on this same PR for this workflow.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
executable-run:
runs-on: starkware-ubuntu-latest-medium
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
- name: Build node
run: |
mkdir data
cargo build -r -p papyrus_node
- name: Run executable
run: >
target/release/papyrus_node --base_layer.node_url ${{ secrets.CI_BASE_LAYER_NODE_URL }}
& sleep 30 ; kill $!
executable-run-no-rpc:
runs-on: starkware-ubuntu-latest-medium
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
- name: Build node
run: |
mkdir data
cargo build -r -p papyrus_node --no-default-features
- name: Run executable
run: >
target/release/papyrus_node --base_layer.node_url ${{ secrets.CI_BASE_LAYER_NODE_URL }}
& sleep 30 ; kill $!
# FIXME: Job is currently running out of disk space, error is hidden inside the `Annoatations`
# tab on github. FIX THE ISSUE AND RE-ENABLE THE JOB.
# p2p-sync-e2e-test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/bootstrap
# - name: Build node
# run: cargo build -r -p papyrus_node
# - name: Run p2p sync end-to-end test
# run: scripts/papyrus/p2p_sync_e2e_test/main.sh ${{ secrets.CI_BASE_LAYER_NODE_URL }}
integration-test:
runs-on: starkware-ubuntu-latest-medium
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
- run: >
cargo test -r
--test latency_histogram
--test gateway_integration_test
--test feeder_gateway_integration_test
-- --include-ignored --skip test_gw_integration_testnet;
cargo run -r -p papyrus_node --bin central_source_integration_test --features="futures-util tokio-stream"
test-no-rpc:
runs-on: starkware-ubuntu-latest-medium
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
- run: |
cargo test -p papyrus_node --no-default-features
env:
SEED: 0
build-papyrus-utilities-image:
runs-on: starkware-ubuntu-latest-medium
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Papyrus utilites docker image
uses: docker/build-push-action@v3.2.0
continue-on-error: true # ignore the failure of a step and avoid terminating the job.
with:
push: false
context: .
file: papyrus_utilities.Dockerfile
cache-from: type=gha,scope=buildkit-ci
cache-to: type=gha,mode=max,scope=buildkit-ci
random-table-test:
runs-on: starkware-ubuntu-latest-medium
steps:
- uses: actions/checkout@v4
# run this job only if the path 'crates/papyrus_storage/src/db/**' is changed, because it takes around 2 minutes.
- uses: dorny/paths-filter@v3
id: changes
with:
# The 'base' and 'ref' parameters are set to be able to run the job in a 'merge_group' event. in a 'pull_request' event
# those parameters are ignored.
base: ${{ github.event.merge_group.base_ref}}
ref: ${{ github.event.merge_group.head_ref }}
filters: |
target_directory:
- 'crates/papyrus_storage/src/db/**'
- uses: ./.github/actions/bootstrap
# repeat this job 32 times. this is a random test for part of the code that may cause a corrupted database.
- run: for run in {1..32}; do cargo test -r -p papyrus_storage -- --include-ignored common_prefix_compare_with_simple_table_random; done
if: steps.changes.outputs.target_directory == 'true'