Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 5 additions & 3 deletions R-package/targeted/.Rbuildignore → .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
^.github$
^.lintr$
^.gitignore$
^Dockerfile$
^Makefile$
^LICENSE$
^dependencies$
^tmp$
^\.travis\.yml$
^\.git$
^\.lintr$
^\.github$
^\.gitignore$
^Makefile$
^src/target/lib$
^README\.Rmd$
^LICENSE$
^examples$
^TODO$
^doc$
Expand Down
98 changes: 0 additions & 98 deletions .github/workflows/py_wheels.yaml

This file was deleted.

73 changes: 44 additions & 29 deletions .github/workflows/r_check.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,64 @@
name: R tests
# runs r cmd check + unit tests in inst/tinytest
on:
pull_request:
branches: [main, develop]

on: [push]
name: r-cmd-check

jobs:
r_targeted:
r-cmd-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, r: 'release'}

runs-on: ${{ matrix.config.os }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- name: Checkout repository incl. submodules
uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-tinytex@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-tinytex@v2
- run: tlmgr --version
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Install dependencies
run: |
sudo apt-get install -y pandoc libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libfontconfig1-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev
- name: Cache R packages
uses: actions/cache@v2
sudo apt-get install -y pandoc libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libpoppler-cpp-dev

- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: |
${{ env.R_LIBS_USER }}
!${{ env.R_LIBS_USER }}/pak
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
extra-packages: |
any::rcmdcheck
any::remotes
any::covr
any::pkgdown
needs: check

- name: Install dependencies
run: |
install.packages(c("remotes","covr","pkgdown","rcmdcheck"), repos="https://cloud.r-project.org")
remotes::install_deps("R-package/targeted", dep=T, upgrade=T)
shell: Rscript {0}
- name: Check
run: |
make r_check pkg=targeted
- name: Upload Coverage to Codecov
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
# args: 'c("--ignore-vignettes")'
# build_args: 'c("--no-build-vignettes")'

- name: Webpage deployment
if: success() && contains('refs/heads/main', github.ref)
run: |
covr::codecov(path="R-package/targeted", type="all")
shell: Rscript {0}
Rscript -e 'remotes::install_github("kkholst/targeted")'
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

- name: Code Coverage
if: success() && contains('refs/heads/main', github.ref)
run: covr::codecov(type=c("tests", "examples"))
shell: Rscript {0}
14 changes: 7 additions & 7 deletions .github/workflows/r_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: publish R package
on:
push:
branches:
- develop
branches: [main]

jobs:
r_targeted:
r_drat:
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
Expand Down Expand Up @@ -43,18 +43,18 @@ jobs:
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache: always
working-directory: R-package/targeted
working-directory: .
extra-packages: any::drat

- name: Build R package
run: |
make r_export
cd build/R
R CMD build targeted
rm -Rf tmp; mkdir -p tmp/targeted
git archive HEAD | (cd tmp/targeted; tar x )
cd tmp; R CMD build targeted

- name: Setting up R repository
run: |
echo 'drat::insertPackage(action="archive", repodir="www/pkg", file=paste0("build/R/", list.files("build/R/", "gz$")))' | R --no-save --no-restore --silent
echo 'drat::insertPackage(action="archive", repodir="www/pkg", file=paste0(tmp/", list.files(tmp/", "gz$")))' | R --no-save --no-restore --silent

- name: Deploy
run: |
Expand Down
38 changes: 4 additions & 34 deletions .github/workflows/target_check.yaml
Original file line number Diff line number Diff line change
@@ -1,56 +1,26 @@
name: target tests
name: target library tests

on: [push]

jobs:
python_package:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']

steps:
- name: Checkout repository incl. submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest-runner pytest-cov scipy patsy numpy pandas statsmodels codecov
- name: Check
run: |
cd python-package/targeted
python setup.py install
python setup.py test
python3 -m targeted
pytest --cov=targeted tests/
bin/test_targeted
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: false

cpp_library:
runs-on: ubuntu-latest
steps:
- name: Checkout repository incl. submodules
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get install -y lcov libblas-dev liblapack-dev
- name: Unit tests
run: |
cd src/target
make test
- name: Coverage
run: |
cd src/target
make coverage
cd build/coverage; make coverage
./target_test -s
Expand Down
67 changes: 52 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,55 @@
.RDataTmp
pkgdown
man/figures/logo.*
docs
inst/doc
vignettes/*.html
vignettes/figure/*chunk*
vignettes/*.R
src/dependencies
*.gcno
TAGS
*.o
*.so
*~
test
*.RData
*.Rhistory
*.Rcheck
.Rproj.user/
*.tar.gz
*.zip
*.tgz
*.obsolete
x.log
nohup.out
tmp
valgrind*
test
*.tmp
*.bbl
*.blg
*.bak
*.snm
*.aux
*.log
*~
*.out
*.swp
*.nav
*.toc
*.vrb
*.dvi
_region*
symbols.rds
doc
Meta
www
*.obs
devel
test.R

autom4te.cache
config.status
R-package/targeted/configure
.RDataTmp

.ccls*
.clangd
Expand All @@ -17,20 +60,14 @@ Debug
citest
notes.org
*.tmp
misc/*.csv
misc/sgd/*.csv
misc/functional
misc/sgd/.ipynb_checkpoints/sgd_test-checkpoint.ipynb
misc/sgd/sgd/.ropeproject/
config/wheel.sh

*.Rcheck
symbols.rds
src/target/misc/*.csv
src/target/misc/sgd/*.csv
src/target/misc/functional
src/target/misc/sgd/.ipynb_checkpoints/sgd_test-checkpoint.ipynb
src/target/misc/sgd/sgd/.ropeproject/
src/target/config/wheel.sh
Rplots*
.#*
examples/functional
examples/test
.Rhistory
examples/*.csv
doc/*guide*pdf
doc/latex
Expand Down
Loading