-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25310e2
commit c0918e8
Showing
6 changed files
with
167 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,3 +135,81 @@ jobs: | |
- uses: r-lib/actions/run-rchk@v2 | ||
with: | ||
run-only: true | ||
|
||
coverage: | ||
needs: rchk | ||
name: Coverage ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
matrix: | ||
config: | ||
- {os: ubuntu-latest, r: 'release'} | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
r-version: ${{ matrix.config.r }} | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::covr | ||
needs: coverage | ||
working-directory: 'R' | ||
|
||
- name: Test coverage | ||
env: | ||
NOT_CRAN: false | ||
run: | | ||
setwd("R/") | ||
covr::codecov(type="all", quiet=FALSE, commentDonttest = FALSE, commentDontrun = FALSE) | ||
shell: Rscript {0} | ||
|
||
pkgdown: | ||
needs: R-CMD-check | ||
if: contains(' | ||
refs/heads/master | ||
refs/heads/main | ||
', github.ref) && github.event_name == 'push' | ||
name: pkgdown ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: ubuntu-latest, r: 'release'} | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::pkgdown, local::. | ||
needs: website | ||
working-directory: 'R' | ||
|
||
- name: Deploy package | ||
if: success() && runner.os == 'Linux' && matrix.config.r == 'release' && github.event_name == 'push' | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Actions" | ||
setwd("R/") | ||
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, run_dont_run = TRUE)' | ||
shell: bash {0} | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,101 @@ | ||
/************************************************************************* | ||
Simple timer functions. | ||
Global timer functions. | ||
--------------------------------------------------------------------- | ||
*************************************************************************/ | ||
#include <stddef.h> | ||
#if DEBUG >= 1 | ||
#include <stdio.h> | ||
#endif | ||
#include <sys/time.h> /* for struct timeval */ | ||
#ifndef WIN32 | ||
#include <sys/resource.h> /* for getrusage */ | ||
#else | ||
/* | ||
getrusage | ||
Implementation according to: | ||
The Open Group Base Specifications Issue 6 | ||
IEEE Std 1003.1, 2004 Edition | ||
Copyright (c) 2005, 2006, 2007 Manuel Lopez-Ibanez | ||
TeX: \copyright 2005, 2006, 2007 Manuel L{\'o}pez-Ib{\'a}{\~n}ez | ||
THIS SOFTWARE IS NOT COPYRIGHTED | ||
This program is free software (software libre); you can redistribute | ||
it and/or modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation; either version 2 of the | ||
License, or (at your option) any later version. | ||
This source code is offered for use in the public domain. You may | ||
use, modify or distribute it freely. | ||
This program is distributed in the hope that it will be useful, but | ||
WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
This code is distributed in the hope that it will be useful but | ||
WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY | ||
DISCLAIMED. This includes but is not limited to warranties of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, you can obtain a copy of the GNU | ||
General Public License at: | ||
http://www.gnu.org/copyleft/gpl.html | ||
or by writing to: | ||
Free Software Foundation, Inc., 59 Temple Place, | ||
Suite 330, Boston, MA 02111-1307 USA | ||
Contributed by: | ||
Ramiro Polla <[email protected]> | ||
---------------------------------------------------------------------- | ||
Modified by: | ||
Manuel Lopez-Ibanez <[email protected]> | ||
* Remove dependency with <sys/resources.h> | ||
**************************************************************************/ | ||
/* | ||
* resource.h | ||
* This file has no copyright assigned and is placed in the Public Domain. | ||
* This file is a part of the mingw-runtime package. | ||
* No warranty is given; refer to the file DISCLAIMER within the package. | ||
* | ||
* Based on: | ||
* http://www.opengroup.org/onlinepubs/000095399/basedefs/sys/resource.h.html | ||
*/ | ||
#define RUSAGE_SELF (1<<0) | ||
#define RUSAGE_CHILDREN (1<<1) | ||
|
||
NOTES: based on source code from Thomas Stuetzle. | ||
struct rusage | ||
{ | ||
struct timeval ru_utime; /* user time used */ | ||
struct timeval ru_stime; /* system time used */ | ||
}; | ||
|
||
/* Include only the minimum from windows.h */ | ||
#define WIN32_LEAN_AND_MEAN | ||
#include <errno.h> | ||
#include <stdint.h> | ||
#include <windows.h> | ||
|
||
static void | ||
FILETIME_to_timeval (struct timeval *tv, FILETIME *ft) | ||
{ | ||
int64_t fulltime = ((((int64_t) ft->dwHighDateTime) << 32) | ||
| ((int64_t) ft->dwLowDateTime)); | ||
fulltime /= 10LL; /* 100-ns -> us */ | ||
tv->tv_sec = fulltime / 1000000L; | ||
tv->tv_usec = fulltime % 1000000L; | ||
} | ||
static int __cdecl | ||
getrusage(int who, struct rusage *r_usage) | ||
{ | ||
FILETIME starttime; | ||
FILETIME exittime; | ||
FILETIME kerneltime; | ||
FILETIME usertime; | ||
|
||
if (!r_usage) { | ||
errno = EFAULT; | ||
return -1; | ||
} | ||
|
||
*************************************************************************/ | ||
if (who != RUSAGE_SELF) { | ||
errno = EINVAL; | ||
return -1; | ||
} | ||
|
||
#include <stdio.h> | ||
#include <sys/time.h> /* for struct timeval */ | ||
#ifndef WIN32 | ||
#include <sys/resource.h> /* for getrusage */ | ||
#else | ||
#include "resource.h" | ||
if (GetProcessTimes (GetCurrentProcess (), | ||
&starttime, &exittime, | ||
&kerneltime, &usertime) == 0) { | ||
return -1; | ||
} | ||
FILETIME_to_timeval (&r_usage->ru_stime, &kerneltime); | ||
FILETIME_to_timeval (&r_usage->ru_utime, &usertime); | ||
return 0; | ||
} | ||
#endif | ||
|
||
#include "timer.h" | ||
|
@@ -95,10 +154,9 @@ double Timer_elapsed_virtual (void) | |
|
||
double Timer_elapsed_real (void) | ||
{ | ||
double timer_tmp_time; | ||
|
||
gettimeofday (&tp, NULL); | ||
timer_tmp_time = TIMER_WALLTIME(tp) - real_time; | ||
double timer_tmp_time = TIMER_WALLTIME(tp) - real_time; | ||
|
||
#if DEBUG >= 2 | ||
if (timer_tmp_time < 0.0) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters