|
14 | 14 | - "**.json" |
15 | 15 | - "**.md" |
16 | 16 | - "**.yml" |
17 | | - - "!**R-cmd-check.yml" |
| 17 | + - "!**R-CMD-check.yml" |
18 | 18 | - "**.R[dD]ata" |
19 | 19 | - "**.Rpro*" |
20 | 20 | pull_request: |
|
29 | 29 | - "**.json" |
30 | 30 | - "**.md" |
31 | 31 | - "**.yml" |
32 | | - - "!**R-cmd-check.yml" |
| 32 | + - "!**R-CMD-check.yml" |
33 | 33 | - "**.R[dD]ata" |
34 | 34 | - "**.Rpro*" |
35 | 35 |
|
@@ -61,96 +61,75 @@ jobs: |
61 | 61 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
62 | 62 |
|
63 | 63 | steps: |
64 | | - - uses: actions/checkout@v3 |
| 64 | + - uses: actions/checkout@v4 |
65 | 65 | with: |
66 | 66 | submodules: true |
| 67 | + |
| 68 | + - name: Install system dependencies (Linux) |
| 69 | + if: runner.os == 'Linux' |
| 70 | + run: | |
| 71 | + sudo apt-get update -y |
| 72 | + sudo apt-get install -y libpoppler-glib-dev bwidget libavfilter-dev libtesseract-dev gdal-bin proj-bin libgdal-dev libproj-dev tesseract-ocr-eng libleptonica-dev tcl libgtk2.0-dev libgtk-3-dev |
| 73 | + sudo pkg-config --libs poppler-glib |
| 74 | + sudo pkg-config --cflags poppler-glib |
67 | 75 |
|
68 | 76 | - uses: r-lib/actions/setup-r@v2 |
69 | 77 | with: |
70 | 78 | r-version: ${{ matrix.config.r }} |
71 | | - |
| 79 | + |
72 | 80 | - uses: r-lib/actions/setup-pandoc@v2 |
73 | | - |
74 | | - - name: Query dependencies |
75 | | - if: runner.os != 'macOS' |
76 | | - run: | |
77 | | - install.packages('remotes') |
78 | | - saveRDS( |
79 | | - remotes::dev_package_deps(dependencies = c("soft", |
80 | | - "Config/Needs/github-actions")), ".github/depends.Rds", version = 2) |
81 | | - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), |
82 | | - ".github/R-version") |
83 | | - shell: Rscript {0} |
84 | | - |
85 | | - - name: Query dependencies (macOS) |
86 | | - if: runner.os == 'macOS' |
87 | | - run: | |
88 | | - install.packages('remotes') |
89 | | - saveRDS( |
90 | | - remotes::dev_package_deps(dependencies = c("soft", |
91 | | - "Config/Needs/coverage", "Config/Needs/github-actions")) |
92 | | - , ".github/depends.Rds", version = 2) |
93 | | - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), |
94 | | - ".github/R-version") |
95 | | - shell: Rscript {0} |
96 | | - |
| 81 | + |
97 | 82 | - name: Cache R packages |
98 | | - if: runner.os != 'Windows' |
99 | | - uses: actions/cache@v3 |
| 83 | + uses: actions/cache@v4 |
100 | 84 | with: |
101 | 85 | path: ${{ env.R_LIBS_USER }} |
102 | 86 | key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} |
103 | 87 | restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- |
104 | | - |
105 | | - - name: Install system dependencies (Linux) |
106 | | - if: runner.os == 'Linux' |
107 | | - run: | |
108 | | - sudo apt-get update -y |
109 | | - sudo apt-get install -y libpoppler-glib-dev bwidget libavfilter-dev libtesseract-dev gdal-bin proj-bin libgdal-dev libproj-dev tesseract-ocr-eng libleptonica-dev tcl libgtk2.0-dev libgtk-3-dev |
110 | | - sudo pkg-config --libs poppler-glib |
111 | | - sudo pkg-config --cflags poppler-glib |
112 | | - while read -r cmd |
113 | | - do |
114 | | - eval sudo $cmd |
115 | | - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') |
116 | | -
|
| 88 | + |
117 | 89 | - name: Install system dependencies (macOS) |
118 | 90 | if: runner.os == 'macOS' |
119 | 91 | run: | |
120 | 92 | brew install libgit2 xquartz |
121 | 93 |
|
122 | | - - name: Install callr (Windows) |
| 94 | + - name: Set up R dependencies (Windows) |
123 | 95 | if: runner.os == 'Windows' |
124 | | - run: | |
125 | | - remotes::install_cran("callr") |
126 | | - shell: Rscript {0} |
127 | | - |
128 | | - - name: Install dependencies |
129 | | - run: | |
130 | | - remotes::install_deps(dependencies = c("soft", "Config/Needs/github-actions")) |
131 | | - shell: Rscript {0} |
132 | | - |
133 | | - - name: Install coverage dependencies |
134 | | - if: runner.os == 'macOS' |
135 | | - run: | |
136 | | - remotes::install_deps(dependencies = 'Config/Needs/coverage') |
137 | | - shell: Rscript {0} |
138 | | - |
139 | | - - name: Check |
140 | | - env: |
141 | | - _R_CHECK_CRAN_INCOMING_REMOTE_: false |
142 | | - run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") |
143 | | - shell: Rscript {0} |
144 | | - |
145 | | - # - name: Upload check results |
146 | | - # if: failure() |
147 | | - # uses: actions/upload-artifact@main |
148 | | - # with: |
149 | | - # name: ${{ runner.os }}-r${{ matrix.config.r }}-results |
150 | | - # path: check |
| 96 | + uses: r-lib/actions/setup-r-dependencies@v2 |
| 97 | + with: |
| 98 | + extra-packages: callr |
| 99 | + needs: | |
| 100 | + check |
| 101 | + coverage |
| 102 | + github-actions |
| 103 | + |
| 104 | + - name: Set up R dependencies (Non-Windows) |
| 105 | + if: runner.os != 'Windows' |
| 106 | + uses: r-lib/actions/setup-r-dependencies@v2 |
| 107 | + with: |
| 108 | + needs: | |
| 109 | + check |
| 110 | + github-actions |
| 111 | + extra-packages: | |
| 112 | + phangorn=?ignore-before-r=4.1.0 |
| 113 | + |
| 114 | + - name: Check package |
| 115 | + uses: r-lib/actions/check-r-package@v2 |
151 | 116 |
|
152 | 117 | - name: Test coverage |
153 | | - if: runner.os == 'macOS' |
| 118 | + if: runner.os == 'Windows' |
154 | 119 | run: | |
155 | 120 | covr::codecov() |
156 | 121 | shell: Rscript {0} |
| 122 | + |
| 123 | + - name: Notify on failure |
| 124 | + if: failure() && github.event_name == 'schedule' |
| 125 | + uses: actions/github-script@v7 |
| 126 | + with: |
| 127 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 128 | + script: | |
| 129 | + github.rest.issues.createComment({ |
| 130 | + owner: context.repo.owner, |
| 131 | + repo: context.repo.repo, |
| 132 | + issue_number: 31, |
| 133 | + body: 'Scheduled workflow has failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' |
| 134 | + }); |
| 135 | +
|
0 commit comments