Skip to content

Commit abffc4d

Browse files
authored
Merge pull request #405 from akshaylg0314/demo25
Fixing the CI/CD pipeline for uploading artifacts on github
2 parents f15c523 + ea9fd83 commit abffc4d

File tree

3 files changed

+37
-28
lines changed

3 files changed

+37
-28
lines changed

.github/workflows/run-ci.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -289,26 +289,26 @@ jobs:
289289
# name: code-coverage-html-agent
290290
# path: dist/coverage/agent/tarpaulin-report-agent.html
291291

292-
# - name: Upload coverage report for player (lcov)
293-
# if: always()
294-
# uses: actions/upload-artifact@v4
295-
# with:
296-
# name: code-coverage-lcov-player
297-
# path: dist/coverage/player/lcov.info
292+
- name: Upload coverage report for player (lcov)
293+
if: always() && hashFiles('dist/coverage/player/lcov.info') != ''
294+
uses: actions/upload-artifact@v4
295+
with:
296+
name: code-coverage-lcov-player
297+
path: dist/coverage/player/lcov.info
298298

299-
# - name: Upload coverage report for player (xml)
300-
# if: always()
301-
# uses: actions/upload-artifact@v4
302-
# with:
303-
# name: code-coverage-xml-player
304-
# path: dist/coverage/player/cobertura.xml
299+
- name: Upload coverage report for player (xml)
300+
if: always() && hashFiles('dist/coverage/player/cobertura.xml') != ''
301+
uses: actions/upload-artifact@v4
302+
with:
303+
name: code-coverage-xml-player
304+
path: dist/coverage/player/cobertura.xml
305305

306-
# - name: Upload coverage report for player (html)
307-
# if: always()
308-
# uses: actions/upload-artifact@v4
309-
# with:
310-
# name: code-coverage-html-player
311-
# path: dist/coverage/player/tarpaulin-report-player.html
306+
- name: Upload coverage report for player (html)
307+
if: always() && hashFiles('dist/coverage/player/tarpaulin-report-player.html') != ''
308+
uses: actions/upload-artifact@v4
309+
with:
310+
name: code-coverage-html-player
311+
path: dist/coverage/player/tarpaulin-report-player.html
312312

313313
# # Step 17: Upload to Codecov
314314
# - name: Upload to Codecov

scripts/test_coverage.sh

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ export RUSTC_BOOTSTRAP=1
5050
COMMON_MANIFEST="src/common/Cargo.toml"
5151
AGENT_MANIFEST="src/agent/Cargo.toml"
5252
TOOLS_MANIFEST="src/tools/Cargo.toml"
53-
SERVER_MANIFEST="src/server/Cargo.toml"
5453
APISERVER_MANIFEST="src/server/apiserver/Cargo.toml"
55-
PLAYER_MANIFEST="src/player/Cargo.toml"
5654
FILTERGATEWAY_MANIFEST="src/player/filtergateway/Cargo.toml"
5755
ACTIONCONTROLLER_MANIFEST="src/player/actioncontroller/Cargo.toml"
5856
STATEMANAGER_MANIFEST="src/player/statemanager/Cargo.toml"
@@ -65,6 +63,7 @@ if [[ -f "$COMMON_MANIFEST" ]]; then
6563
cd "$(dirname "$COMMON_MANIFEST")"
6664
cargo tarpaulin --out Html --out Lcov --out Xml \
6765
--output-dir "$PROJECT_ROOT/$COVERAGE_ROOT/common" \
66+
--ignore-panics --no-fail-fast \
6867
2>&1 | tee -a "$LOG_FILE" || true
6968
)
7069
mv "$PROJECT_ROOT/$COVERAGE_ROOT/common/tarpaulin-report.html" "$PROJECT_ROOT/$COVERAGE_ROOT/common/tarpaulin-report-common.html" 2>/dev/null || true
@@ -96,6 +95,7 @@ if [[ -f "$TOOLS_MANIFEST" ]]; then
9695
cd "$(dirname "$TOOLS_MANIFEST")"
9796
cargo tarpaulin --out Html --out Lcov --out Xml \
9897
--output-dir "$PROJECT_ROOT/$COVERAGE_ROOT/tools" \
98+
--ignore-panics --no-fail-fast \
9999
2>&1 | tee -a "$LOG_FILE" || true
100100
)
101101
mv "$PROJECT_ROOT/$COVERAGE_ROOT/tools/tarpaulin-report.html" "$PROJECT_ROOT/$COVERAGE_ROOT/tools/tarpaulin-report-tools.html" 2>/dev/null || true
@@ -104,23 +104,29 @@ else
104104
fi
105105

106106
# === Step 2: Start `filtergateway` and `nodeagent` before apiserver ===
107+
rm -rf /tmp/pullpiri_shared_rocksdb
108+
mkdir -p /tmp/pullpiri_shared_rocksdb
109+
# Make directory writable by all users (container needs write access)
110+
chmod 777 /tmp/pullpiri_shared_rocksdb
107111
start_service "$FILTERGATEWAY_MANIFEST" "filtergateway"
108112
start_service "$AGENT_MANIFEST" "nodeagent"
113+
start_service "$STATEMANAGER_MANIFEST" "statemanager"
109114
sleep 3
110115

111116
# === SERVER ===
112-
if [[ -f "$SERVER_MANIFEST" ]]; then
113-
echo "📂 Running tarpaulin for server" | tee -a "$LOG_FILE"
117+
if [[ -f "$APISERVER_MANIFEST" ]]; then
118+
echo "📂 Running tarpaulin for server (apiserver)" | tee -a "$LOG_FILE"
114119
mkdir -p "$COVERAGE_ROOT/server"
115120
(
116-
cd "$(dirname "$SERVER_MANIFEST")"
121+
cd "$(dirname "$APISERVER_MANIFEST")"
117122
cargo tarpaulin --out Html --out Lcov --out Xml \
118123
--output-dir "$PROJECT_ROOT/$COVERAGE_ROOT/server" \
124+
--skip-clean --ignore-panics --no-fail-fast \
119125
2>&1 | tee -a "$LOG_FILE" || true
120126
)
121127
mv "$PROJECT_ROOT/$COVERAGE_ROOT/server/tarpaulin-report.html" "$PROJECT_ROOT/$COVERAGE_ROOT/server/tarpaulin-report-server.html" 2>/dev/null || true
122128
else
123-
echo "::warning ::$SERVER_MANIFEST not found. Skipping..." | tee -a "$LOG_FILE"
129+
echo "::warning ::$APISERVER_MANIFEST not found. Skipping..." | tee -a "$LOG_FILE"
124130
fi
125131

126132
# Stop background services before next round
@@ -143,18 +149,19 @@ start_service "$STATEMANAGER_MANIFEST" "statemanager"
143149
# Note: RocksDB data cleanup handled by service or via gRPC API if needed
144150
sleep 3
145151

146-
if [[ -f "$PLAYER_MANIFEST" ]]; then
147-
echo "📂 Running tarpaulin for player" | tee -a "$LOG_FILE"
152+
if [[ -f "$FILTERGATEWAY_MANIFEST" ]]; then
153+
echo "📂 Running tarpaulin for player (filtergateway)" | tee -a "$LOG_FILE"
148154
mkdir -p "$COVERAGE_ROOT/player"
149155
(
150-
cd "$(dirname "$PLAYER_MANIFEST")"
156+
cd "$(dirname "$FILTERGATEWAY_MANIFEST")"
151157
cargo tarpaulin --out Html --out Lcov --out Xml \
152158
--output-dir "$PROJECT_ROOT/$COVERAGE_ROOT/player" \
159+
--ignore-panics --no-fail-fast \
153160
2>&1 | tee -a "$LOG_FILE" || true
154161
)
155162
mv "$PROJECT_ROOT/$COVERAGE_ROOT/player/tarpaulin-report.html" "$PROJECT_ROOT/$COVERAGE_ROOT/player/tarpaulin-report-player.html" 2>/dev/null || true
156163
else
157-
echo "::warning ::$PLAYER_MANIFEST not found. Skipping..." | tee -a "$LOG_FILE"
164+
echo "::warning ::$FILTERGATEWAY_MANIFEST not found. Skipping..." | tee -a "$LOG_FILE"
158165
fi
159166

160167
cleanup

src/server/apiserver/tests/filtergateway_integration.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ spec:
4747

4848
/// Test sending with valid scenario and Action::Apply
4949
#[tokio::test]
50+
#[ignore = "Requires FilterGateway service to be running"]
5051
async fn test_send_with_valid_scenario_apply() {
5152
let scenario = HandleScenarioRequest {
5253
action: Action::Apply.into(),
@@ -59,6 +60,7 @@ async fn test_send_with_valid_scenario_apply() {
5960

6061
/// Test sending with valid scenario and Action::Withdraw
6162
#[tokio::test]
63+
#[ignore = "Requires FilterGateway service to be running"]
6264
async fn test_send_with_valid_scenario_withdraw() {
6365
let scenario = HandleScenarioRequest {
6466
action: Action::Withdraw.into(),

0 commit comments

Comments
 (0)