Skip to content

Commit 370798b

Browse files
Update r1.yml
1 parent e5c3583 commit 370798b

1 file changed

Lines changed: 33 additions & 45 deletions

File tree

.github/workflows/r1.yml

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ jobs:
1919
- name: Checkout repository
2020
uses: actions/checkout@v4
2121

22+
- name: Debug repo contents
23+
run: |
24+
pwd
25+
echo "=== top level ==="
26+
ls -la
27+
echo "=== notebooks ==="
28+
ls -la notebooks || true
29+
echo "=== analysis/R ==="
30+
ls -la analysis/R || true
31+
echo "=== data files ==="
32+
find data -maxdepth 4 -type f || true
33+
2234
- name: Set up R
2335
uses: r-lib/actions/setup-r@v2
2436
with:
@@ -28,62 +40,38 @@ jobs:
2840
- name: Install system dependencies
2941
run: |
3042
sudo apt-get update
31-
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev
43+
sudo apt-get install -y \
44+
libcurl4-openssl-dev libssl-dev libxml2-dev \
45+
build-essential gfortran \
46+
libfontconfig1-dev libfreetype6-dev \
47+
libharfbuzz-dev libfribidi-dev
3248
3349
- name: Restore R environment with renv
3450
run: |
3551
Rscript -e 'install.packages("renv", repos = "https://cloud.r-project.org")'
3652
Rscript -e 'renv::restore(prompt = FALSE)'
3753
38-
- name: Run full analysis pipeline
39-
run: |
40-
Rscript notebooks/01_load_and_clean.R
41-
Rscript notebooks/02_exploration.R
42-
Rscript notebooks/03_feature_engineering.R
43-
Rscript notebooks/04_model_training.R
44-
Rscript notebooks/05_evaluation.R
45-
Rscript notebooks/09_tables_confusion_matrices.R
54+
- name: Create output directory
55+
run: mkdir -p output
4656

47-
- name: List output directory
57+
- name: Run full analysis pipeline
4858
run: |
49-
ls -la output || true
50-
51-
- name: Verify outputs
59+
set -e
60+
Rscript --vanilla notebooks/01_load_and_clean.R
61+
Rscript --vanilla notebooks/02_exploration.R
62+
Rscript --vanilla notebooks/03_feature_engineering.R
63+
Rscript --vanilla notebooks/04_model_training.R
64+
Rscript --vanilla notebooks/05_evaluation.R
65+
Rscript --vanilla notebooks/09_tables_confusion_matrices.R
66+
67+
- name: Debug list outputs
68+
if: always()
5269
run: |
53-
# Figures 1–4 from EDA
54-
test -f output/Figure_1_Correlation_Matrix_Diabetes.png
55-
test -f output/Figure_2_Correlation_Matrix_Heart_Failure.png
56-
test -f output/Figure_3_Age_Distribution_Diabetes.png
57-
test -f output/Figure_4_Age_Distribution_Heart_Failure.png
58-
59-
# Models saved to output (ensure 04_model_training.R saves here)
60-
test -f output/logistic_model.rds
61-
test -f output/random_forest_model.rds
62-
63-
# Pooled OOF evaluation artifacts
64-
test -f output/oof_predictions_logit.csv
65-
test -f output/oof_predictions_rf.csv
66-
test -f output/chosen_thresholds_youden.csv
67-
test -f output/confusion_matrix_logit_oof_youden.csv
68-
test -f output/confusion_matrix_rf_oof_youden.csv
69-
test -f output/performance_metrics_oof_youden.csv
70-
71-
# Full caret printed confusion reports
72-
test -f output/logistic_regression_confusion_report_oof_youden.txt
73-
test -f output/random_forest_confusion_report_oof_youden.txt
74-
75-
# ROC plots
76-
test -f output/roc_logit_oof.png
77-
test -f output/roc_rf_oof.png
78-
79-
# Journal-style confusion matrix tables (Tables 5–6)
80-
test -f output/Table_5_Logistic_Regression_Confusion_Matrix_OOF_Youden.csv
81-
test -f output/Table_6_Random_Forest_Confusion_Matrix_OOF_Youden.csv
82-
test -f output/Table_5_Logistic_Regression_Confusion_Matrix_OOF_Youden.txt
83-
test -f output/Table_6_Random_Forest_Confusion_Matrix_OOF_Youden.txt
84-
test -f output/Table_Confusion_Matrix_Summary_Youden_OOF.csv
70+
echo "=== output files ==="
71+
find output -maxdepth 5 -type f | sort || true
8572
8673
- name: Upload outputs as artifacts
74+
if: always()
8775
uses: actions/upload-artifact@v4
8876
with:
8977
name: analysis-outputs

0 commit comments

Comments
 (0)