Skip to content

Commit b7f305a

Browse files
update tic templates
1 parent 5952c53 commit b7f305a

File tree

1 file changed

+12
-55
lines changed

1 file changed

+12
-55
lines changed

.github/workflows/main.yml

+12-55
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## tic GitHub Actions template: linux-macos-windows-deploy
2-
## revision date: 2020-05-21
2+
## revision date: 2020-06-14
33
on:
44
push:
55
pull_request:
@@ -8,10 +8,10 @@ on:
88
# * is a special character in YAML so you have to quote this string
99
- cron: "0 4 * * *"
1010

11-
name: R CMD Check via {tic}
11+
name: tic
1212

1313
jobs:
14-
R-CMD-check:
14+
all:
1515
runs-on: ${{ matrix.config.os }}
1616

1717
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
@@ -22,20 +22,14 @@ jobs:
2222
config:
2323
# use a different tic template type if you do not want to build on all listed platforms
2424
- { os: windows-latest, r: "release" }
25-
- { os: macOS-latest, r: "release", pkgdown: "true" }
25+
- { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" }
2626
- { os: macOS-latest, r: "devel" }
2727
- { os: ubuntu-latest, r: "release" }
2828

2929
env:
3030
# otherwise remotes::fun() errors cause the build to fail. Example: Unavailability of binaries
3131
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
3232
CRAN: ${{ matrix.config.cran }}
33-
# we are not allowed to write to ~/.ccache on GH Actions
34-
# setting some ccache options
35-
CCACHE_BASEDIR: ${{ GITHUB.WORKSPACE }}
36-
CCACHE_DIR: ${{ GITHUB.WORKSPACE }}/.ccache
37-
CCACHE_NOHASHDIR: true
38-
CCACHE_SLOPPINESS: include_file_ctime
3933
# make sure to run `tic::use_ghactions_deploy()` to set up deployment
4034
TIC_DEPLOY_KEY: ${{ secrets.TIC_DEPLOY_KEY }}
4135
# prevent rgl issues because no X11 display is available
@@ -45,7 +39,7 @@ jobs:
4539
BUILD_PKGDOWN: ${{ matrix.config.pkgdown }}
4640
# macOS >= 10.15.4 linking
4741
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
48-
# use GITHUB_TOKEN from GItHub to workaround rate limits in {remotes}
42+
# use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes}
4943
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
5044

5145
steps:
@@ -60,74 +54,37 @@ jobs:
6054
# Linux: ~ 1 min
6155
# macOS: ~ 1 min 30s
6256
# Windows: never finishes
63-
- uses: r-lib/actions/setup-tinytex@v1
64-
if: runner.os != 'Windows'
57+
- uses: r-lib/actions/setup-tinytex@master
58+
if: matrix.config.latex == 'true'
6559

6660
- uses: r-lib/actions/setup-pandoc@master
6761

6862
# set date/week for use in cache creation
6963
# https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970
7064
# - cache R packages daily
71-
# - cache ccache weekly -> 'ccache' helps rebuilding the package cache faster
7265
- name: "[Cache] Prepare daily timestamp for cache"
7366
if: runner.os != 'Windows'
7467
id: date
7568
run: echo "::set-output name=date::$(date '+%d-%m')"
7669

77-
- name: "[Cache] Prepare weekly timestamp for cache"
78-
if: runner.os != 'Windows'
79-
id: datew
80-
run: echo "::set-output name=datew::$(date '+%Y-%V')"
81-
8270
- name: "[Cache] Cache R packages"
8371
if: runner.os != 'Windows'
84-
uses: pat-s/always-upload-cache@v1.2.0
72+
uses: pat-s/always-upload-cache@v2.0.0
8573
with:
8674
path: ${{ env.R_LIBS_USER }}
8775
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
8876
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
8977

90-
- name: "[Cache] Cache ccache"
91-
if: runner.os != 'Windows'
92-
uses: pat-s/always-upload-cache@v1.2.0
93-
with:
94-
path: ${{ env.CCACHE_DIR}}
95-
key: ${{ runner.os }}-r-${{ matrix.config.r }}-ccache-${{steps.datew.outputs.datew}}
96-
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-ccache-${{steps.datew.outputs.datew}}
97-
98-
# install ccache and write config file
99-
- name: "[Linux] ccache"
100-
if: runner.os == 'Linux'
101-
run: |
102-
sudo apt install ccache libcurl4-openssl-dev
103-
mkdir -p ~/.R && echo -e 'CC=ccache gcc -std=gnu99\nCXX=ccache g++\nFC=ccache gfortran\nF77=ccache gfortran' > $HOME/.R/Makevars
104-
105-
# install ccache and write config file
106-
# mirror the setup described in https://github.com/rmacoslib/r-macos-rtools
107-
- name: "[macOS] ccache"
108-
if: runner.os == 'macOS' && matrix.config.r == 'devel'
109-
run: |
110-
brew install ccache
111-
# install SDK 10.13 (High Sierra, used by CRAN)
112-
wget -nv https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.13.sdk.tar.xz
113-
tar fxz MacOSX10.13.sdk.tar.xz
114-
sudo mv MacOSX10.13.sdk /Library/Developer/CommandLineTools/SDKs/
115-
rm -rf MacOSX10.13*
116-
# install gfortran 8.2 (used by CRAN)
117-
wget -nv https://github.com/fxcoudert/gfortran-for-macOS/releases/download/8.2/gfortran-8.2-Mojave.dmg
118-
sudo hdiutil attach gfortran*.dmg
119-
sudo installer -package /Volumes/gfortran*/gfortran*/gfortran*.pkg -target /
120-
sudo hdiutil detach /Volumes/gfortran-8.2-Mojave
121-
rm gfortran-8*
122-
# set compiler flags
123-
mkdir -p ~/.R && echo -e 'CC=ccache clang\nCPP=ccache clang\nCXX=ccache clang++\nCXX11=ccache clang++\nCXX14=ccache clang++\nCXX17=ccache clang++\nCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk\nCCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk\nCXXFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk\nCPPFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk -I/usr/local/include\nF77=ccache /usr/local/gfortran/bin/gfortran\nFC=ccache /usr/local/gfortran/bin/gfortran' > $HOME/.R/Makevars
124-
12578
# for some strange Windows reason this step and the next one need to be decoupled
12679
- name: "[Stage] Prepare"
12780
run: |
12881
Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')"
12982
Rscript -e "if (getRversion() < '3.2' && !requireNamespace('curl')) install.packages('curl', type = 'source')"
13083
84+
- name: "[Stage] [Linux] Install curl"
85+
if: runner.os == 'Linux'
86+
run: sudo apt install libcurl4-openssl-dev
87+
13188
- name: "[Stage] Install"
13289
if: matrix.config.os != 'macOS-latest' || matrix.config.r != 'devel'
13390
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()"

0 commit comments

Comments
 (0)