11# # tic GitHub Actions template: linux-macos-windows-deploy
2- # # revision date: 2022-03-01
2+ # # revision date: 2022-08-28
33on :
44 workflow_dispatch :
55 push :
66 branches :
77 - main
88 - master
9+ - cran-*
910 pull_request :
1011 branches :
1112 - main
@@ -28,24 +29,19 @@ jobs:
2829 matrix :
2930 config :
3031 # use a different tic template type if you do not want to build on all listed platforms
31- # - { os: windows-latest, r: "release" }
32- # - { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" }
32+ - { os: windows-latest, r: "release" }
33+ - { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" }
3334 - { os: ubuntu-latest, r: "devel" }
34- - { os: ubuntu-latest, r: "release", pkgdown: "true" }
35+ - { os: ubuntu-latest, r: "release" }
3536
3637 env :
37- # otherwise remotes::fun() errors cause the build to fail. Example: Unavailability of binaries
38- R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
39- CRAN : ${{ matrix.config.cran }}
4038 # make sure to run `tic::use_ghactions_deploy()` to set up deployment
4139 TIC_DEPLOY_KEY : ${{ secrets.TIC_DEPLOY_KEY }}
4240 # prevent rgl issues because no X11 display is available
4341 RGL_USE_NULL : true
4442 # if you use bookdown or blogdown, replace "PKGDOWN" by the respective
4543 # capitalized term. This also might need to be done in tic.R
4644 BUILD_PKGDOWN : ${{ matrix.config.pkgdown }}
47- # macOS >= 10.15.4 linking
48- SDKROOT : /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
4945 # use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes}
5046 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
5147
@@ -72,60 +68,22 @@ jobs:
7268
7369 - name : " [Cache] Cache R packages"
7470 if : runner.os != 'Windows'
75- uses : pat-s/always-upload-cache@v2
71+ uses : pat-s/always-upload-cache@v3
7672 with :
7773 path : ${{ env.R_LIBS_USER }}
7874 key : ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
7975 restore-keys : ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
8076
81- - name : " [Stage] [Linux] Install required system libs"
82- if : runner.os == 'Linux'
83- run : sudo apt install libcurl4-openssl-dev libgit2-dev
84-
85- # for some strange Windows reason this step and the next one need to be decoupled
86- - name : " [Stage] Prepare"
87- run : |
88- Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')"
89- Rscript -e "if (!requireNamespace('curl')) install.packages('curl', type = 'source')"
90-
91- - name : " [Stage] [macOS] Install libgit2"
92- if : runner.os == 'macOS'
93- run : brew install libgit2
94-
95- - name : " [Stage] [macOS] Install system libs for pkgdown"
96- if : runner.os == 'macOS' && matrix.config.pkgdown != ''
97- run : brew install harfbuzz fribidi
98-
99- - name : " [Stage] [Linux] Install system libs for pkgdown"
100- if : runner.os == 'Linux' && matrix.config.pkgdown != ''
101- run : sudo apt install libharfbuzz-dev libfribidi-dev
102-
103- # Try to automatically check for system dependencies and install them
104- # Note: this might not catch all required system libs and manual action might be needed
105- - name : " [Stage] [Linux] Install linux system dependencies"
106- if : runner.os == 'Linux'
107- run : |
108- while read -r cmd
109- do
110- eval sudo $cmd
111- done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
77+ - name : " [Stage] Install pak"
78+ run : Rscript -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/stable')"
11279
11380 - name : " [Stage] Install"
114- if : matrix.config.os != 'macOS-latest' || matrix.config.r != 'devel'
115- 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()"
116-
117- # macOS devel needs its own stage because we need to work with an option to suppress the usage of binaries
118- - name : " [Stage] Prepare & Install (macOS-devel)"
119- if : matrix.config.os == 'macOS-latest' && matrix.config.r == 'devel'
120- run : |
121- echo -e 'options(Ncpus = 4, pkgType = "source", repos = structure(c(CRAN = "https://cloud.r-project.org/")))' > $HOME/.Rprofile
122- Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"
81+ run : Rscript -e "if (grepl('Ubuntu', Sys.info()[['version']]) && !grepl('Under development', R.version[['status']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}else{options(repos = c(CRAN = 'cloud.r-project.org'))}; pak::pkg_install('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"
12382
12483 - name : " [Stage] Script"
12584 run : Rscript -e 'tic::script()'
12685
12786 - name : " [Stage] After Success"
128- if : matrix.config.os == 'macOS-latest' && matrix.config.r == 'release'
12987 run : Rscript -e "tic::after_success()"
13088
13189 - name : " [Stage] Upload R CMD check artifacts"
0 commit comments