From 1f8a4f21f8bd7259363abf8762b6efd9c6d9f267 Mon Sep 17 00:00:00 2001 From: pat-s Date: Sun, 28 Aug 2022 13:23:47 +0200 Subject: [PATCH 1/3] test --- .github/workflows/tic.yml | 68 ++++++++------------------------------- 1 file changed, 14 insertions(+), 54 deletions(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index 26e1eaaf..0c86cc44 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -1,13 +1,17 @@ -## tic GitHub Actions template: linux-macos-windows-deploy -## revision date: 2022-03-01 -# [Custom header] +## tic GitHub Actions template: linux-deploy +## revision date: 2022-08-28 on: workflow_dispatch: push: branches: - - main - - cran-* + - main + - master + - cran-* + - pak pull_request: + branches: + - main + - master # for now, CRON jobs only run on the default branch of the repo (i.e. usually on master) schedule: # * is a special character in YAML so you have to quote this string @@ -26,13 +30,9 @@ jobs: matrix: config: # use a different tic template type if you do not want to build on all listed platforms - - { os: ubuntu-latest, r: "devel" } - - { os: ubuntu-latest, r: "release", pkgdown: true, latex: true } + - { os: ubuntu-latest, r: "release", pkgdown: "true" } env: - # otherwise remotes::fun() errors cause the build to fail. Example: Unavailability of binaries - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - CRAN: ${{ matrix.config.cran }} # make sure to run `tic::use_ghactions_deploy()` to set up deployment TIC_DEPLOY_KEY: ${{ secrets.TIC_DEPLOY_KEY }} # prevent rgl issues because no X11 display is available @@ -40,8 +40,6 @@ jobs: # if you use bookdown or blogdown, replace "PKGDOWN" by the respective # capitalized term. This also might need to be done in tic.R BUILD_PKGDOWN: ${{ matrix.config.pkgdown }} - # macOS >= 10.15.4 linking - SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk # use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -68,60 +66,22 @@ jobs: - name: "[Cache] Cache R packages" if: runner.os != 'Windows' - uses: pat-s/always-upload-cache@v2 + uses: pat-s/always-upload-cache@v3 with: path: ${{ env.R_LIBS_USER }} key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}} restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}} - - name: "[Stage] [Linux] Install required system libs" - if: runner.os == 'Linux' - run: sudo apt install libcurl4-openssl-dev libgit2-dev - - # for some strange Windows reason this step and the next one need to be decoupled - - name: "[Stage] Prepare" - run: | - Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')" - Rscript -e "if (!requireNamespace('curl')) install.packages('curl', type = 'source')" - - - name: "[Stage] [macOS] Install libgit2" - if: runner.os == 'macOS' - run: brew install libgit2 - - - name: "[Stage] [macOS] Install system libs for pkgdown" - if: runner.os == 'macOS' && matrix.config.pkgdown != '' - run: brew install harfbuzz fribidi - - - name: "[Stage] [Linux] Install system libs for pkgdown" - if: runner.os == 'Linux' && matrix.config.pkgdown != '' - run: sudo apt install libharfbuzz-dev libfribidi-dev - - # Try to automatically check for system dependencies and install them - # Note: this might not catch all required system libs and manual action might be needed - - name: "[Stage] [Linux] Install linux system dependencies" - if: runner.os == 'Linux' - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + - name: "[Stage] Install pak" + run: Rscript -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/stable')" - name: "[Stage] Install" - if: matrix.config.os != 'macOS-latest' || matrix.config.r != 'devel' - run: Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" - - # macOS devel needs its own stage because we need to work with an option to suppress the usage of binaries - - name: "[Stage] Prepare & Install (macOS-devel)" - if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'devel' - run: | - echo -e 'options(Ncpus = 4, pkgType = "source", repos = structure(c(CRAN = "https://cloud.r-project.org/")))' > $HOME/.Rprofile - Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" + run: Rscript -e "if (grepl('Ubuntu', Sys.info()[['version']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}; pak::pkg_install('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" - name: "[Stage] Script" run: Rscript -e 'tic::script()' - name: "[Stage] After Success" - if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'release' run: Rscript -e "tic::after_success()" - name: "[Stage] Upload R CMD check artifacts" From c4b54292337acff567ffb465a98f163cb24c4687 Mon Sep 17 00:00:00 2001 From: pat-s Date: Sun, 28 Aug 2022 13:24:26 +0200 Subject: [PATCH 2/3] test --- .github/workflows/tic.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index 0c86cc44..1630eb60 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -1,4 +1,4 @@ -## tic GitHub Actions template: linux-deploy +## tic GitHub Actions template: linux-macos-windows-deploy ## revision date: 2022-08-28 on: workflow_dispatch: @@ -30,7 +30,10 @@ jobs: matrix: config: # use a different tic template type if you do not want to build on all listed platforms - - { os: ubuntu-latest, r: "release", pkgdown: "true" } + - { os: windows-latest, r: "release" } + - { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" } + - { os: ubuntu-latest, r: "devel" } + - { os: ubuntu-latest, r: "release" } env: # make sure to run `tic::use_ghactions_deploy()` to set up deployment @@ -90,12 +93,3 @@ jobs: with: name: ${{ runner.os }}-r${{ matrix.config.r }}-results path: check - - name: "[Stage] Before Deploy" - run: | - Rscript -e "tic::before_deploy()" - - - name: "[Stage] Deploy" - run: Rscript -e "tic::deploy()" - - - name: "[Stage] After Deploy" - run: Rscript -e "tic::after_deploy()" From 38b12459da235b9e5fde686607c370744e0c57c1 Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 29 Aug 2022 09:02:29 +0200 Subject: [PATCH 3/3] update `update-tic.yml` --- .github/workflows/update-tic.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update-tic.yml b/.github/workflows/update-tic.yml index 20f13038..7a7e4da6 100644 --- a/.github/workflows/update-tic.yml +++ b/.github/workflows/update-tic.yml @@ -2,7 +2,7 @@ on: workflow_dispatch: schedule: # * is a special character in YAML so you have to quote this string - - cron: "0 4 * * *" + - cron: "0 4 * * 0" # every week name: Update tic @@ -23,27 +23,26 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: persist-credentials: false - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} Ncpus: 4 - name: "[Stage] Dependencies" run: | - sudo apt install libcurl4-openssl-dev libsodium-dev libharfbuzz-dev libfribidi-dev libgit2-dev - Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')" - Rscript -e "remotes::install_github('ropensci/tic', dependencies = TRUE)" + Rscript -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/stable')" + Rscript -e "if (grepl('Ubuntu', Sys.info()[['version']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}; pak::pkg_install('ropensci/tic', dependencies = TRUE)" - name: "[Stage] Update YAMLs" run: | Rscript -e "tic::update_yml()" - name: "[Stage] Create Pull Request" - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> token: ${{ secrets.TIC_UPDATE }}