From 9b36813420fe344add4bff1eb40846500b804792 Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 21:24:37 +0200 Subject: [PATCH 01/15] More workflows. --- .github/workflows/document.yaml | 46 +++++++++++++++++++++ .github/workflows/submit-cran.yaml | 23 +++++++++++ .github/workflows/test-coverage.yaml | 62 ++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 .github/workflows/document.yaml create mode 100644 .github/workflows/submit-cran.yaml create mode 100644 .github/workflows/test-coverage.yaml diff --git a/.github/workflows/document.yaml b/.github/workflows/document.yaml new file mode 100644 index 0000000..24934b7 --- /dev/null +++ b/.github/workflows/document.yaml @@ -0,0 +1,46 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + paths: ["R/**"] + +name: document.yaml + +permissions: read-all + +jobs: + document: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup R + uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - name: Install dependencies + uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::roxygen2 + needs: roxygen2 + + - name: Document + run: roxygen2::roxygenise() + shell: Rscript {0} + + - name: Commit and push changes + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add man/\* NAMESPACE DESCRIPTION + git commit -m "Update documentation" || echo "No changes to commit" + git pull --ff-only + git push origin diff --git a/.github/workflows/submit-cran.yaml b/.github/workflows/submit-cran.yaml new file mode 100644 index 0000000..6457a40 --- /dev/null +++ b/.github/workflows/submit-cran.yaml @@ -0,0 +1,23 @@ +name: Submit to CRAN + +on: + release: + types: [prereleased] + +jobs: + cran-submission: + runs-on: ubuntu-latest + name: Submit package to CRAN + permissions: + contents: read + issues: write # Needed to create issues + steps: + - uses: actions/checkout@v4 + + - name: Submit R package to CRAN + uses: coatless-actions/cran-submission@v1 + with: + pkg-directory: '.' # Directory containing the package + check-directory: 'check' # Directory for check outputs + error-on: 'warning' # Fail on warnings + create-issue: true # Create issues to track submissions diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..c3df460 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,62 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main] + pull_request: + +name: test-coverage.yaml + +permissions: read-all + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::covr, any::xml2 + needs: coverage + + - name: Test coverage + run: | + cov <- covr::package_coverage( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + print(cov) + covr::to_cobertura(cov) + shell: Rscript {0} + + - uses: codecov/codecov-action@v5 + with: + # Fail if error if not on PR, or if on PR and token is given + fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} + files: ./cobertura.xml + plugins: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package From 84af1dd0b24fc755d222a5df145e10c1bbcae323 Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 21:29:02 +0200 Subject: [PATCH 02/15] Always run. --- .github/workflows/document.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/document.yaml b/.github/workflows/document.yaml index 24934b7..f7a6e55 100644 --- a/.github/workflows/document.yaml +++ b/.github/workflows/document.yaml @@ -2,7 +2,7 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - paths: ["R/**"] + # paths: ["R/**"] name: document.yaml From 1d6cb6bab69f2f8458e5b8ce41a8e77738cbd2b8 Mon Sep 17 00:00:00 2001 From: jtilly Date: Mon, 22 Sep 2025 19:32:23 +0000 Subject: [PATCH 03/15] Update documentation --- DESCRIPTION | 2 +- man/matchingR-deprecated.Rd | 2 ++ man/matchingR-package.Rd | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 305bf5c..2198f4f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,4 +18,4 @@ Depends: Rcpp LinkingTo: Rcpp, RcppArmadillo Suggests: testthat, knitr, rmarkdown VignetteBuilder: knitr -RoxygenNote: 7.1.1 +RoxygenNote: 7.3.3 diff --git a/man/matchingR-deprecated.Rd b/man/matchingR-deprecated.Rd index 84b0dde..187d12d 100644 --- a/man/matchingR-deprecated.Rd +++ b/man/matchingR-deprecated.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/deprecated.R \docType{package} \name{matchingR-deprecated} +\alias{-package} \alias{matchingR-deprecated} \alias{validateInputs} \alias{checkStability} @@ -47,3 +48,4 @@ the matchingR package. Eventually, these functions will be removed. \code{checkStabilityTopTradingCycle} \tab was replaced by \code{\link{cpp_wrapper_ttc_check_stability}}\cr } } + diff --git a/man/matchingR-package.Rd b/man/matchingR-package.Rd index b2adc48..9aba727 100644 --- a/man/matchingR-package.Rd +++ b/man/matchingR-package.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/matchingR.R \docType{package} \name{matchingR-package} -\alias{matchingR} \alias{matchingR-package} \title{matchingR: Matching Algorithms in R and C++} \description{ From 156b22ece9159e57f750cc33307abc796cfabb0c Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 21:34:35 +0200 Subject: [PATCH 04/15] Only run when R code is changed. --- .github/workflows/document.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/document.yaml b/.github/workflows/document.yaml index f7a6e55..24934b7 100644 --- a/.github/workflows/document.yaml +++ b/.github/workflows/document.yaml @@ -2,7 +2,7 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - # paths: ["R/**"] + paths: ["R/**"] name: document.yaml From 880e23b87888771c9461b2f888c0fb56b9848adb Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 21:37:50 +0200 Subject: [PATCH 05/15] Add workflow to run compileAttributes. --- .github/workflows/rcpp.yaml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/rcpp.yaml diff --git a/.github/workflows/rcpp.yaml b/.github/workflows/rcpp.yaml new file mode 100644 index 0000000..15b5372 --- /dev/null +++ b/.github/workflows/rcpp.yaml @@ -0,0 +1,46 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + paths: ["R/**"] + +name: rcpp.yaml + +permissions: read-all + +jobs: + document: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup R + uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - name: Install dependencies + uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::Rcpp + needs: Rcpp + + - name: Compile Attributes + run: Rcpp::compileAttributes() + shell: Rscript {0} + + - name: Commit and push changes + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add man/\* NAMESPACE DESCRIPTION + git commit -m "Generate attributes" || echo "No changes to commit" + git pull --ff-only + git push origin From fb0bacc480755b9a715ab5caae93314dc3569042 Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 21:38:45 +0200 Subject: [PATCH 06/15] Always run. --- .github/workflows/document.yaml | 1 - .github/workflows/rcpp.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/document.yaml b/.github/workflows/document.yaml index 24934b7..825ea99 100644 --- a/.github/workflows/document.yaml +++ b/.github/workflows/document.yaml @@ -2,7 +2,6 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - paths: ["R/**"] name: document.yaml diff --git a/.github/workflows/rcpp.yaml b/.github/workflows/rcpp.yaml index 15b5372..2a097f1 100644 --- a/.github/workflows/rcpp.yaml +++ b/.github/workflows/rcpp.yaml @@ -2,7 +2,6 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - paths: ["R/**"] name: rcpp.yaml From 8b3f808f16fe22950fe50ff178e3d2d669afde75 Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 21:39:36 +0200 Subject: [PATCH 07/15] Fix name. --- .github/workflows/rcpp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rcpp.yaml b/.github/workflows/rcpp.yaml index 2a097f1..8984046 100644 --- a/.github/workflows/rcpp.yaml +++ b/.github/workflows/rcpp.yaml @@ -8,7 +8,7 @@ name: rcpp.yaml permissions: read-all jobs: - document: + compile-attributes: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} From 2fee344e567d51f79e7de6c35e516d7d6873814a Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 21:48:11 +0200 Subject: [PATCH 08/15] Remove package suffix. --- R/matchingR.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/matchingR.R b/R/matchingR.R index 0d1acbf..b7678cc 100644 --- a/R/matchingR.R +++ b/R/matchingR.R @@ -15,7 +15,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -#' @name matchingR-package +#' @name matchingR #' @docType package #' @title matchingR: Matching Algorithms in R and C++ #' @description matchingR is an R package which quickly computes a variety of From 620cea53d7908a8e16b641cb06b37ce24fd7dd4d Mon Sep 17 00:00:00 2001 From: jtilly Date: Mon, 22 Sep 2025 19:50:18 +0000 Subject: [PATCH 09/15] Update documentation --- man/matchingR-package.Rd | 107 --------------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 man/matchingR-package.Rd diff --git a/man/matchingR-package.Rd b/man/matchingR-package.Rd deleted file mode 100644 index 9aba727..0000000 --- a/man/matchingR-package.Rd +++ /dev/null @@ -1,107 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/matchingR.R -\docType{package} -\name{matchingR-package} -\alias{matchingR-package} -\title{matchingR: Matching Algorithms in R and C++} -\description{ -matchingR is an R package which quickly computes a variety of - matching algorithms for one-sided and two-sided markets. This package - implements - \itemize{ - \item{the Gale-Shapley Algorithm to compute the stable matching for - two-sided markets, such as the stable marriage problem and the - college-admissions problem} - \item{Irving's Algorithm to compute the stable matching for one-sided - markets such as the stable roommates problem} - \item{the top trading cycle algorithm for the indivisible goods trading - problem.} - } - - All matching algorithms are implemented in \code{C++} and can therefore be - computed quickly. The package may be useful when the number of market - participants is large or when many matchings need to be computed (e.g. for - extensive simulations or for estimation purposes). The Gale-Shapley - function of this package has successfully been used to simulate preferences - and compute the matching with 30,000 participants on each side of the - market. - - Matching markets are common in practice and widely studied by - economists. Popular examples include - \itemize{ - \item{the National Resident Matching Program that matches graduates from - medical school to residency programs at teaching hospitals throughout the - United States} - \item{the matching of students to schools including the New York City High - School Match or the the Boston Public School Match (and many more)} - \item{the matching of kidney donors to recipients in kidney exchanges.} - } -} -\examples{ -# stable marriage problem -set.seed(1) -nmen <- 25 -nwomen <- 20 -uM <- matrix(runif(nmen * nwomen), nrow = nwomen, ncol = nmen) -uW <- matrix(runif(nwomen * nmen), nrow = nmen, ncol = nwomen) -results <- galeShapley.marriageMarket(uM, uW) -galeShapley.checkStability(uM, uW, results$proposals, results$engagements) - -# college admissions problem -nstudents <- 25 -ncolleges <- 5 -uStudents <- matrix(runif(nstudents * ncolleges), nrow = ncolleges, ncol = nstudents) -uColleges <- matrix(runif(nstudents * ncolleges), nrow = nstudents, ncol = ncolleges) -results <- galeShapley.collegeAdmissions( - studentUtils = uStudents, - collegeUtils = uColleges, - slots = 4 -) -results -# check stability -galeShapley.checkStability( - uStudents, - uColleges, - results$matched.students, - results$matched.colleges -) - -# stable roommate problem -set.seed(2) -N <- 10 -u <- matrix(runif(N^2), nrow = N, ncol = N) -results <- roommate(utils = u) -results -# check stability -roommate.checkStability(utils = u, matching = results) - -# top trading cycle algorithm -N <- 10 -u <- matrix(runif(N^2), nrow = N, ncol = N) -results <- toptrading(utils = u) -results -# check stability -toptrading.checkStability(utils = u, matching = results) -} -\references{ -Gale, D. and Shapley, L.S. (1962). College admissions and the - stability of marriage. \emph{The American Mathematical Monthly}, 69(1): - 9--15. - -Irving, R. W. (1985). An efficient algorithm for the "stable - roommates" problem. \emph{Journal of Algorithms}, 6(4): 577--595 - -Shapley, L., & Scarf, H. (1974). On cores and indivisibility. - \emph{Journal of Mathematical Economics}, 1(1), 23-37. -} -\seealso{ -Useful links: -\itemize{ - \item \url{https://github.com/jtilly/matchingR/} - \item Report bugs at \url{https://github.com/jtilly/matchingR/issues/} -} - -} -\author{ -Jan Tilly, Nick Janetos -} From e2c22982932bb9ef90334e522a9c194384a83c1c Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 21:58:18 +0200 Subject: [PATCH 10/15] Run CI. From f23b2d14dffef61451e13fac7cd299d5c51bf4ac Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 22:02:37 +0200 Subject: [PATCH 11/15] Remove deprecated functions. --- R/deprecated.R | 109 ------------------------------------------------- 1 file changed, 109 deletions(-) delete mode 100644 R/deprecated.R diff --git a/R/deprecated.R b/R/deprecated.R deleted file mode 100644 index 0fdc400..0000000 --- a/R/deprecated.R +++ /dev/null @@ -1,109 +0,0 @@ -# matchingR -- Matching Algorithms in R and C++ -# -# Copyright (C) 2015 Jan Tilly -# Nick Janetos -# -# This file is part of matchingR. -# -# matchingR is free software: 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. -# -# matchingR 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. - -#' Deprecated Functions in matchingR -#' -#' These functions are provided for compatibility with older version of -#' the matchingR package. Eventually, these functions will be removed. -#' -#' @rdname matchingR-deprecated -#' @name matchingR-deprecated -#' @param ... generic set of parameters --- see documentation of new functions -#' @docType package -#' @aliases validateInputs checkStability checkPreferenceOrder one2many many2one -#' one2one galeShapleyMatching stableRoommateMatching onesided -#' checkStabilityRoommate validateInputsOneSided checkPreferenceOrderOnesided -#' topTradingCycle checkStabilityTopTradingCycle -#' @section Details: -#' \tabular{rl}{ -#' \code{validateInputs} \tab was replaced by \code{\link{galeShapley.validate}}\cr -#' \code{checkStability} \tab was replaced by \code{\link{galeShapley.checkStability}}\cr -#' \code{checkPreferenceOrder} \tab was replaced by \code{\link{galeShapley.checkPreferences}}\cr -#' \code{one2many} \tab now mapped into \code{\link{galeShapley.collegeAdmissions}}\cr -#' \code{many2one} \tab now mapped into \code{\link{galeShapley.collegeAdmissions}}\cr -#' \code{one2one} \tab was replaced by \code{\link{galeShapley.marriageMarket}}\cr -#' \code{galeShapleyMatching} \tab was replaced by \code{\link{cpp_wrapper_galeshapley}}\cr -#' \code{stableRoommateMatching} \tab was replaced by \code{\link{cpp_wrapper_irving}}\cr -#' \code{onesided} \tab was replaced by \code{\link{roommate}}\cr -#' \code{checkStabilityRoommate} \tab was replaced by \code{\link{cpp_wrapper_irving_check_stability}}\cr -#' \code{validateInputsOneSided} \tab was replaced by \code{\link{roommate.validate}}\cr -#' \code{checkPreferenceOrderOnesided} \tab was replaced by \code{\link{roommate.checkPreferences}}\cr -#' \code{topTradingCycle} \tab was replaced by \code{\link{cpp_wrapper_ttc}}\cr -#' \code{checkStabilityTopTradingCycle} \tab was replaced by \code{\link{cpp_wrapper_ttc_check_stability}}\cr -#' } -#' -validateInputs <- function(...) { - .Deprecated("galeShapley.validate") - galeShapley.validate(...) -} -checkStability <- function(...) { - .Deprecated("galeShapley.checkStability") - galeShapley.checkStability(...) -} -checkPreferenceOrder <- function(...) { - .Deprecated("galeShapley.checkPreferences") - galeShapley.checkPreferences(...) -} -one2many <- function(...) { - .Deprecated("galeShapley.collegeAdmissions") - galeShapley.collegeAdmissions(..., studentOptimal = TRUE) -} -many2one <- function(...) { - .Deprecated("galeShapley.collegeAdmissions") - galeShapley.collegeAdmissions(..., studentOptimal = FALSE) -} -one2one <- function(...) { - .Deprecated("galeShapley.marriageMarket") - galeShapley.marriageMarket(...) -} -galeShapleyMatching <- function(...) { - .Deprecated("cpp_wrapper_galeshapley") - cpp_wrapper_galeshapley(...) -} -stableRoommateMatching <- function(...) { - .Deprecated("cpp_wrapper_irving") - cpp_wrapper_irving(...) -} -onesided <- function(...) { - .Deprecated("roommate") - roommate(...) -} -checkStabilityRoommate <- function(...) { - .Deprecated("cpp_wrapper_irving_check_stability") - cpp_wrapper_irving_check_stability(...) -} -validateInputsOneSided <- function(...) { - .Deprecated("roommate.validate") - roommate.validate(...) -} -checkPreferenceOrderOnesided <- function(...) { - .Deprecated("roommate.checkPreferences") - roommate.checkPreferences(...) -} -topTradingCycle <- function(...) { - .Deprecated("cpp_wrapper_ttc") - cpp_wrapper_ttc(...) -} -checkStabilityTopTradingCycle <- function(...) { - .Deprecated("cpp_wrapper_ttc_check_stability") - toptrading.checkStability(...) -} -toptrading <- function(...) { - .Deprecated("toptrading") - toptrading(...) -} -NULL From 071e06d321c716bdf01c34ab749226dde6ce6a59 Mon Sep 17 00:00:00 2001 From: jtilly Date: Mon, 22 Sep 2025 20:07:00 +0000 Subject: [PATCH 12/15] Update documentation --- man/matchingR-deprecated.Rd | 51 ------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 man/matchingR-deprecated.Rd diff --git a/man/matchingR-deprecated.Rd b/man/matchingR-deprecated.Rd deleted file mode 100644 index 187d12d..0000000 --- a/man/matchingR-deprecated.Rd +++ /dev/null @@ -1,51 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/deprecated.R -\docType{package} -\name{matchingR-deprecated} -\alias{-package} -\alias{matchingR-deprecated} -\alias{validateInputs} -\alias{checkStability} -\alias{checkPreferenceOrder} -\alias{one2many} -\alias{many2one} -\alias{one2one} -\alias{galeShapleyMatching} -\alias{stableRoommateMatching} -\alias{onesided} -\alias{checkStabilityRoommate} -\alias{validateInputsOneSided} -\alias{checkPreferenceOrderOnesided} -\alias{topTradingCycle} -\alias{checkStabilityTopTradingCycle} -\title{Deprecated Functions in matchingR} -\usage{ -validateInputs(...) -} -\arguments{ -\item{...}{generic set of parameters --- see documentation of new functions} -} -\description{ -These functions are provided for compatibility with older version of -the matchingR package. Eventually, these functions will be removed. -} -\section{Details}{ - -\tabular{rl}{ - \code{validateInputs} \tab was replaced by \code{\link{galeShapley.validate}}\cr - \code{checkStability} \tab was replaced by \code{\link{galeShapley.checkStability}}\cr - \code{checkPreferenceOrder} \tab was replaced by \code{\link{galeShapley.checkPreferences}}\cr - \code{one2many} \tab now mapped into \code{\link{galeShapley.collegeAdmissions}}\cr - \code{many2one} \tab now mapped into \code{\link{galeShapley.collegeAdmissions}}\cr - \code{one2one} \tab was replaced by \code{\link{galeShapley.marriageMarket}}\cr - \code{galeShapleyMatching} \tab was replaced by \code{\link{cpp_wrapper_galeshapley}}\cr - \code{stableRoommateMatching} \tab was replaced by \code{\link{cpp_wrapper_irving}}\cr - \code{onesided} \tab was replaced by \code{\link{roommate}}\cr - \code{checkStabilityRoommate} \tab was replaced by \code{\link{cpp_wrapper_irving_check_stability}}\cr - \code{validateInputsOneSided} \tab was replaced by \code{\link{roommate.validate}}\cr - \code{checkPreferenceOrderOnesided} \tab was replaced by \code{\link{roommate.checkPreferences}}\cr - \code{topTradingCycle} \tab was replaced by \code{\link{cpp_wrapper_ttc}}\cr - \code{checkStabilityTopTradingCycle} \tab was replaced by \code{\link{cpp_wrapper_ttc_check_stability}}\cr -} -} - From fd56beb536687e8df1b2b5c8d7879a47d976168d Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 22:07:29 +0200 Subject: [PATCH 13/15] Run CI. From 32888f4dd4c5a6f033423cf1dffaa3769a39f40f Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 22:17:39 +0200 Subject: [PATCH 14/15] Use PR commands. --- .github/workflows/document.yaml | 45 ----------- .github/workflows/pr-commands.yaml | 125 +++++++++++++++++++++++++++++ .github/workflows/rcpp.yaml | 45 ----------- 3 files changed, 125 insertions(+), 90 deletions(-) delete mode 100644 .github/workflows/document.yaml create mode 100644 .github/workflows/pr-commands.yaml delete mode 100644 .github/workflows/rcpp.yaml diff --git a/.github/workflows/document.yaml b/.github/workflows/document.yaml deleted file mode 100644 index 825ea99..0000000 --- a/.github/workflows/document.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: - push: - -name: document.yaml - -permissions: read-all - -jobs: - document: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - permissions: - contents: write - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup R - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - name: Install dependencies - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::roxygen2 - needs: roxygen2 - - - name: Document - run: roxygen2::roxygenise() - shell: Rscript {0} - - - name: Commit and push changes - run: | - git config --local user.name "$GITHUB_ACTOR" - git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" - git add man/\* NAMESPACE DESCRIPTION - git commit -m "Update documentation" || echo "No changes to commit" - git pull --ff-only - git push origin diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml new file mode 100644 index 0000000..9a09f68 --- /dev/null +++ b/.github/workflows/pr-commands.yaml @@ -0,0 +1,125 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + issue_comment: + types: [created] + +name: pr-commands.yaml + +permissions: read-all + +jobs: + document: + if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }} + name: document + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/pr-fetch@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::roxygen2 + needs: pr-document + + - name: Document + run: roxygen2::roxygenise() + shell: Rscript {0} + + - name: commit + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add man/\* NAMESPACE + git commit -m 'Document' + + - uses: r-lib/actions/pr-push@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + + compile: + if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }} + name: compile + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/pr-fetch@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::Rcpp + needs: pr-document + + - name: Document + run: Rcpp::compileAttributes() + shell: Rscript {0} + + - name: commit + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add man/\* NAMESPACE + git commit -m 'Compile attributes' + + - uses: r-lib/actions/pr-push@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + style: + if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }} + name: style + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/pr-fetch@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - uses: r-lib/actions/setup-r@v2 + + - name: Install dependencies + run: install.packages("styler") + shell: Rscript {0} + + - name: Style + run: styler::style_pkg() + shell: Rscript {0} + + - name: commit + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add \*.R + git commit -m 'Style' + + - uses: r-lib/actions/pr-push@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/rcpp.yaml b/.github/workflows/rcpp.yaml deleted file mode 100644 index 8984046..0000000 --- a/.github/workflows/rcpp.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: - push: - -name: rcpp.yaml - -permissions: read-all - -jobs: - compile-attributes: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - permissions: - contents: write - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup R - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - name: Install dependencies - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::Rcpp - needs: Rcpp - - - name: Compile Attributes - run: Rcpp::compileAttributes() - shell: Rscript {0} - - - name: Commit and push changes - run: | - git config --local user.name "$GITHUB_ACTOR" - git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" - git add man/\* NAMESPACE DESCRIPTION - git commit -m "Generate attributes" || echo "No changes to commit" - git pull --ff-only - git push origin From eefe15eaf57dcd5c5588eb3a882c6a011a552f1d Mon Sep 17 00:00:00 2001 From: Jan Tilly Date: Mon, 22 Sep 2025 22:21:12 +0200 Subject: [PATCH 15/15] Fix commands. --- .github/workflows/pr-commands.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml index 9a09f68..3f40bf9 100644 --- a/.github/workflows/pr-commands.yaml +++ b/.github/workflows/pr-commands.yaml @@ -50,7 +50,7 @@ jobs: compile: - if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }} + if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/compile') }} name: compile runs-on: ubuntu-latest env: @@ -71,9 +71,9 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: any::Rcpp - needs: pr-document + needs: pr-compile - - name: Document + - name: Compile run: Rcpp::compileAttributes() shell: Rscript {0}