-
Notifications
You must be signed in to change notification settings - Fork 49
130 lines (111 loc) · 4.27 KB
/
Copy pathtest_build_docu_dev.yml
File metadata and controls
130 lines (111 loc) · 4.27 KB
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
# Workflow based on https://github.com/actions/starter-workflows/blob/main/ci/python-package.yml
name: Test Docu Build (with dev pkgs)
on:
push:
branches:
- main
pull_request:
branches:
- main
- dev
workflow_dispatch:
inputs:
doubleml-py-branch:
description: 'Branch in https://github.com/DoubleML/doubleml-for-py'
required: true
default: 'main'
doubleml-r-branch:
description: 'Branch in https://github.com/DoubleML/doubleml-for-r'
required: true
default: 'main'
nbsphinx-execute:
description: 'Execute notebooks with nbsphinx'
required: false
default: 'auto'
schedule:
- cron: "0 9 * * 1,3,5"
jobs:
build:
runs-on: ubuntu-22.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out the repo containing the docu source
uses: actions/checkout@v4
- name: Check out the repo containing the python pkg DoubleML (dev)
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: actions/checkout@v4
with:
repository: DoubleML/doubleml-for-py
path: doubleml-for-py
- name: Check out the repo containing the python pkg DoubleML (dev)
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@v4
with:
repository: DoubleML/doubleml-for-py
path: doubleml-for-py
ref: ${{ github.event.inputs.doubleml-py-branch }}
- name: Install graphviz
run: sudo apt-get install graphviz
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies and the python package
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip uninstall -y DoubleML
cd doubleml-for-py
pip install -e .[rdd]
- name: Add R repository
run: |
sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/'
- name: Install R
run: |
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev
sudo apt-get install -y zlib1g-dev libicu-dev pandoc make libcurl4-openssl-dev libssl-dev
- name: Get user library folder
run: |
mkdir ${GITHUB_WORKSPACE}/tmp_r_libs_user
echo R_LIBS_USER=${GITHUB_WORKSPACE}/tmp_r_libs_user >> $GITHUB_ENV
- name: Query R version
run: |
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Cache R packages
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: doubleml-test-build-dev-${{ hashFiles('.github/R-version') }}
- name: Install R kernel for Jupyter and the R package DoubleML (dev)
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
install.packages('remotes')
remotes::install_github('DoubleML/doubleml-for-r', dependencies = TRUE)
install.packages(c('ggplot2', 'IRkernel', 'xgboost', 'hdm', 'reshape2', 'gridExtra', "igraph", "mlr3filters", "mlr3measures", "did"))
IRkernel::installspec()
shell: Rscript {0}
- name: Install R kernel for Jupyter and the R package DoubleML (dev)
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
install.packages('remotes')
remotes::install_github('DoubleML/doubleml-for-r@${{ github.event.inputs.doubleml-r-branch }}', dependencies = TRUE)
install.packages(c('ggplot2', 'IRkernel', 'xgboost', 'hdm', 'reshape2', 'gridExtra', "igraph", "mlr3filters", "mlr3measures", "did"))
IRkernel::installspec()
shell: Rscript {0}
- name: Build docu with sphinx
run: |
make -C doc html NBSPHINX_EXECUTE=${{ github.event.inputs.nbsphinx-execute || 'auto' }}
- name: Check for broken links / URLs
run: |
make -C doc linkcheck
- name: Upload html artifacts
uses: actions/upload-artifact@v4
with:
name: build_html
path: doc/_build/html/