From c259643b9c7f081f39c0d5266bcd1f3a32245efe Mon Sep 17 00:00:00 2001 From: Stella Date: Tue, 12 Dec 2023 08:19:24 +0100 Subject: [PATCH] Remove unused workflows --- .github/workflows/R-CMD-check.yaml | 130 ------------------- .github/workflows/build_docs.yaml | 176 -------------------------- .github/workflows/main.yaml | 195 ----------------------------- 3 files changed, 501 deletions(-) delete mode 100644 .github/workflows/R-CMD-check.yaml delete mode 100644 .github/workflows/build_docs.yaml delete mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml deleted file mode 100644 index 61700b5..0000000 --- a/.github/workflows/R-CMD-check.yaml +++ /dev/null @@ -1,130 +0,0 @@ -# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. -# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions -on: - workflow_dispatch: - -name: R-CMD-check - -jobs: - R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: windows-2022, r: 'release'} - - {os: macOS-12, r: 'release'} - - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - name: Checkout pharmr - uses: actions/checkout@v3 - with: - path: pharmr_repo - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.config.r }} - - - uses: r-lib/actions/setup-pandoc@v2 - - - name: Query dependencies - working-directory: pharmr_repo - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - uses: actions/setup-python@v2 - with: - python-version: "3.11" - - - name: Restore R package cache - if: runner.os != 'Windows' - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install system dependencies - working-directory: pharmr_repo - if: runner.os == 'Linux' - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - sudo apt install libcurl4-openssl-dev - - - name: Install png (temporary) - working-directory: pharmr_repo - if: runner.os == 'Windows' - run: | - install.packages('png', repos='https://mran.microsoft.com/snapshot/2022-11-27') - shell: Rscript {0} - - - name: Install R dependencies - working-directory: pharmr_repo - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - install.packages('reticulate') - shell: Rscript {0} - - - name: Install pharmr - working-directory: pharmr_repo - run: | - remotes::install_local(force=TRUE) - shell: Rscript {0} - - - name: Install miniconda - run: | - Sys.setenv(RETICULATE_MINICONDA_PYTHON_VERSION="3.9") - reticulate::install_miniconda() - shell: Rscript {0} - - - name: Install Pharmpy - run: | - pharmr::install_pharmpy() - shell: Rscript {0} - - - name: Check (as cran) - working-directory: pharmr_repo - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: | - options(crayon.enabled = TRUE) - rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main - with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results-cran - path: check - - - name: Check (to run python) - working-directory: pharmr_repo - run: | - options(crayon.enabled = TRUE) - rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main - with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check \ No newline at end of file diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml deleted file mode 100644 index c849c42..0000000 --- a/.github/workflows/build_docs.yaml +++ /dev/null @@ -1,176 +0,0 @@ -on: workflow_dispatch - -name: Build docs - -jobs: - deploy: - runs-on: ubuntu-20.04 - - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - name: Checkout pharmr - uses: actions/checkout@v3 - with: - path: pharmr_repo - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: 'release' - - - uses: r-lib/actions/setup-pandoc@v2 - - - name: Query dependencies - working-directory: pharmr_repo - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - uses: actions/setup-python@v2 - with: - python-version: "3.11" - - - name: Restore R package cache - if: runner.os != 'Windows' - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install system dependencies - working-directory: pharmr_repo - if: runner.os == 'Linux' - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - - - name: Install R dependencies - working-directory: pharmr_repo - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - install.packages('reticulate') - shell: Rscript {0} - - - name: Install pharmr - working-directory: pharmr_repo - run: | - remotes::install_local(force=TRUE) - shell: Rscript {0} - - - name: Checkout Pharmpy - uses: actions/checkout@v3 - with: - repository: pharmpy/pharmpy - path: pharmpy_repo - fetch-depth: 0 - - - name: Set up Pharmpy release version - working-directory: pharmpy_repo - run: | - git checkout -b release_latest "$(git rev-list --tags --max-count=1)" - echo "pharmpy_version=`git describe --tags`" >> $GITHUB_ENV - git branch -v - - - name: Install Pharmpy in venv - working-directory: pharmpy_repo - run: | - python3.11 -m venv pharmpy_venv - source pharmpy_venv/bin/activate - pip install . - - - name: Test Pharmpy - working-directory: pharmr_repo - run: | - reticulate::py_discover_config() - reticulate::use_python('../pharmpy_repo/pharmpy_venv/bin') - pharmr::print_pharmpy_version() - shell: Rscript {0} - - - name: Install deploy dependencies - run: | - install.packages("devtools") - install.packages("promises") - shell: Rscript {0} - - - name: Update DESCRIPTION and documentation - working-directory: pharmr_repo/deploy - run: | - reticulate::use_python('../../pharmpy_repo/pharmpy_venv/bin') - - pharmpy <- reticulate::import("pharmpy") - pharmpy_version <- pharmpy$`__version__` - desc::desc_set('Version', pharmpy_version) - desc::desc_set('Date', Sys.Date()) - - reticulate::py_run_file('build_functions.py') - devtools::document() - shell: Rscript {0} - - - name: Check - working-directory: pharmr_repo - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: | - reticulate::py_discover_config() - reticulate::use_python('../pharmpy_repo/pharmpy_venv/bin') - pharmr::print_pharmpy_version() - options(crayon.enabled = TRUE) - rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main - with: - name: results-cran - path: check - - - name: Set up git config - working-directory: pharmr_repo - run: | - git config --local user.name "github-actions[bot]" - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - - - name: Add changes to DESCRIPTION and documentation - working-directory: pharmr_repo - run: | - git add DESCRIPTION - git add NAMESPACE - git add R/functions_wrapper.R - git add man/ - git status - - - name: Check if any files have been staged - working-directory: pharmr_repo - run: | - if [[ "$(git diff --name-only --cached | wc -c)" != "0" ]]; then - echo "has_been_updated=true" >> $GITHUB_ENV - else - echo "has_been_updated=false" >> $GITHUB_ENV - fi - - - name: Commit and push changes, tag version - if: ${{ env.has_been_updated == 'true' }} - working-directory: pharmr_repo - run: | - echo "Committing changes" - git commit -m "Update DESCRIPTION/documentation" - echo "Tag version" - git tag "${{ env.pharmpy_version }}" - echo "Push changes" - git push https://$USERNAME:$REPO_KEY@github.com/pharmpy/pharmr.git - echo "push tags" - git push --tags https://$USERNAME:$REPO_KEY@github.com/pharmpy/pharmr.git - env: - REPO_KEY: ${{secrets.ACCESS_TOKEN}} - USERNAME: github-actions[bot] - diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml deleted file mode 100644 index de34ada..0000000 --- a/.github/workflows/main.yaml +++ /dev/null @@ -1,195 +0,0 @@ -on: - workflow_call: - inputs: - as-release: - required: true - type: boolean - outputs: - pharmpy_version: - description: "Version of Pharmpy used" - value: ${{ jobs.run-tests.outputs.output }} - -name: Main CI workflow - -jobs: - run-tests: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - outputs: - output: ${{ steps.get_pharmpy_version.outputs.pharmpy_version }} - - strategy: - fail-fast: false - matrix: - config: - - {os: windows-2022, r: 'release'} - - {os: macOS-12, r: 'release'} - - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - name: Checkout pharmr - uses: actions/checkout@v3 - with: - path: pharmr_repo - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.config.r }} - - - uses: r-lib/actions/setup-pandoc@v2 - - - name: Query dependencies - working-directory: pharmr_repo - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - uses: actions/setup-python@v2 - with: - python-version: "3.11" - - - name: Restore R package cache - if: runner.os != 'Windows' - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install system dependencies - working-directory: pharmr_repo - if: runner.os == 'Linux' - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - sudo apt install libcurl4-openssl-dev - - - name: Install png (temporary) - working-directory: pharmr_repo - if: runner.os == 'Windows' - run: | - install.packages('png', repos='https://mran.microsoft.com/snapshot/2022-11-27') - shell: Rscript {0} - - - name: Install R packages - working-directory: pharmr_repo - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - install.packages('reticulate') - install.packages('devtools') - install.packages('promises') - remotes::install_local(force=TRUE) - shell: Rscript {0} - - - name: Checkout Pharmpy - uses: actions/checkout@v3 - with: - repository: pharmpy/pharmpy - path: pharmpy_repo - fetch-depth: 0 - - - name: Set up Pharmpy release version - working-directory: pharmpy_repo - if: ${{ inputs.as-release == true }} - run: | - git checkout -b release_latest "$(git rev-list --tags --max-count=1)" - - - id: get_pharmpy_version - working-directory: pharmpy_repo - if: ${{ inputs.as-release == true && runner.os == 'Linux'}} - run: | - echo "pharmpy_version=`git describe --tags`" >> $GITHUB_OUTPUT - - - name: Install Pharmpy in venv - working-directory: pharmpy_repo - if: runner.os != 'Windows' - run: | - python3 -m venv pharmpy_venv - source pharmpy_venv/bin/activate - pip install . - - - name: Install Pharmpy in venv - working-directory: pharmpy_repo - if: runner.os == 'Windows' - run: | - python -m venv pharmpy_venv - pharmpy_venv\Scripts\activate - pip install . - - - name: Start Pharmpy venv - working-directory: pharmr_repo - run: | - reticulate::py_discover_config() - venv_path = file.path('..', 'pharmpy_repo', 'pharmpy_venv') - if(.Platform$OS.type == "unix") { - venv_path = file.path(venv_path, 'bin') - } else { - venv_path = file.path(venv_path, 'Scripts') - } - reticulate::use_python(venv_path) - pharmr::print_pharmpy_version() - shell: Rscript {0} - - - name: Update DESCRIPTION and documentation - working-directory: pharmr_repo/deploy - run: | - venv_path = file.path('..', '..', 'pharmpy_repo', 'pharmpy_venv') - if(.Platform$OS.type == "unix") { - venv_path = file.path(venv_path, 'bin') - } else { - venv_path = file.path(venv_path, 'Scripts') - } - reticulate::use_python(venv_path) - - pharmpy <- reticulate::import("pharmpy") - pharmpy_version <- pharmpy$`__version__` - desc::desc_set('Version', pharmpy_version) - desc::desc_set('Date', Sys.Date()) - - reticulate::py_run_file('build_functions.py') - devtools::document() - shell: Rscript {0} - - - name: Check pharmr - working-directory: pharmr_repo - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: | - venv_path = file.path('..', 'pharmpy_repo', 'pharmpy_venv') - if(.Platform$OS.type == "unix") { - venv_path = file.path(venv_path, 'bin') - } else { - venv_path = file.path(venv_path, 'Scripts') - } - reticulate::use_python(venv_path) - pharmr::print_pharmpy_version() - options(crayon.enabled = TRUE) - rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main - with: - name: results-cran - path: check - - - name: Upload pharmr directory - uses: actions/upload-artifact@v3 - if: ${{ inputs.as-release == true && runner.os == 'Linux'}} - with: - name: pharmr_repo - path: pharmr_repo \ No newline at end of file