Browse code

Attempt in fixing build errors.

Markus Riester authored on 30/03/2025 18:34:28
Showing 1 changed files

... ...
@@ -34,8 +34,8 @@ name: R-CMD-check-bioc
34 34
 ## Note that you can always run a GHA test without the cache by using the word
35 35
 ## "/nocache" in the commit message.
36 36
 env:
37
-  has_testthat: 'true'
38
-  run_covr: 'true'
37
+  has_testthat: 'false'
38
+  run_covr: 'false'
39 39
   run_pkgdown: 'false'
40 40
   has_RUnit: 'false'
41 41
   cache-version: 'cache-v1'
... ...
@@ -52,7 +52,7 @@ jobs:
52 52
       fail-fast: false
53 53
       matrix:
54 54
         config:
55
-          - { os: ubuntu-latest, r: '4.3', bioc: '3.17', cont: "bioconductor/bioconductor_docker:RELEASE_3_17", rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest" }
55
+          - { os: ubuntu-latest, r: '4.4', bioc: '3.19', cont: "bioconductor/bioconductor_docker:RELEASE_3_19", rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest" }
56 56
           ## Check https://github.com/r-lib/actions/tree/master/examples
57 57
           ## for examples using the http-user-agent
58 58
     env:
... ...
@@ -103,16 +103,16 @@ jobs:
103 103
         uses: actions/cache@v3
104 104
         with:
105 105
           path: ${{ env.R_LIBS_USER }}
106
-          key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_17-r-4.3-${{ hashFiles('.github/depends.Rds') }}
107
-          restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_17-r-4.3-
106
+          key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_19-r-4.4-${{ hashFiles('.github/depends.Rds') }}
107
+          restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_19-r-4.4-
108 108
 
109 109
       - name: Cache R packages on Linux
110 110
         if: "!contains(github.event.head_commit.message, '/nocache') && runner.os == 'Linux' "
111 111
         uses: actions/cache@v3
112 112
         with:
113 113
           path: /home/runner/work/_temp/Library
114
-          key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_17-r-4.3-${{ hashFiles('.github/depends.Rds') }}
115
-          restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_17-r-4.3-
114
+          key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_19-r-4.4-${{ hashFiles('.github/depends.Rds') }}
115
+          restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_19-r-4.4-
116 116
 
117 117
       - name: Install Linux system dependencies
118 118
         if: runner.os == 'Linux'
... ...
@@ -124,11 +124,11 @@ jobs:
124 124
       - name: Install GATK4
125 125
         if: runner.os == 'Linux'
126 126
         run: |
127
-           wget --no-verbose https://github.com/broadinstitute/gatk/releases/download/4.4.0.0/gatk-4.4.0.0.zip
127
+           wget --no-verbose https://github.com/broadinstitute/gatk/releases/download/4.6.1.0/gatk-4.6.1.0.zip
128 128
            mkdir $HOME/tools
129
-           unzip gatk-4.4.0.0.zip -d $HOME/tools
130
-           sudo -s ln -s "$HOME/tools/gatk-4.4.0.0/gatk" /usr/local/bin/gatk
131
-           rm gatk-4.4.0.0.zip
129
+           unzip gatk-4.6.1.0.zip -d $HOME/tools
130
+           sudo -s ln -s "$HOME/tools/gatk-4.6.1.0/gatk" /usr/local/bin/gatk
131
+           rm gatk-4.6.1.0.zip
132 132
 
133 133
       - name: Show GATK4 version
134 134
         if: runner.os == 'Linux'
... ...
@@ -136,32 +136,6 @@ jobs:
136 136
            echo "$PATH"
137 137
            gatk --version
138 138
 
139
-      - name: Install macOS system dependencies
140
-        if: matrix.config.os == 'macOS-latest'
141
-        run: |
142
-          ## Enable installing XML from source if needed
143
-          brew install libxml2
144
-          echo "XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config" >> $GITHUB_ENV
145
-
146
-          ## Required to install magick as noted at
147
-          ## https://github.com/r-lib/usethis/commit/f1f1e0d10c1ebc75fd4c18fa7e2de4551fd9978f#diff-9bfee71065492f63457918efcd912cf2
148
-          brew install imagemagick@6
149
-
150
-          ## For textshaping, required by ragg, and required by pkgdown
151
-          brew install harfbuzz fribidi
152
-
153
-          ## For installing usethis's dependency gert
154
-          brew install libgit2
155
-
156
-          ## Required for tcltk
157
-          brew install xquartz --cask
158
-
159
-      - name: Install Windows system dependencies
160
-        if: runner.os == 'Windows'
161
-        run: |
162
-          ## Edit below if you have any Windows system dependencies
163
-        shell: Rscript {0}
164
-
165 139
       - name: Install BiocManager
166 140
         run: |
167 141
           message(paste('****', Sys.time(), 'installing BiocManager ****'))
... ...
@@ -182,35 +156,19 @@ jobs:
182 156
           ## https://github.com/r-lib/remotes/issues/296
183 157
           ## Ideally, all dependencies should get installed in the first pass.
184 158
 
185
-          ## Set the repos source depending on the OS
186
-          ## Alternatively use https://storage.googleapis.com/bioconductor_docker/packages/
187
-          ## though based on https://bit.ly/bioc2021-package-binaries
188
-          ## the Azure link will be the main one going forward.
189
-          gha_repos <- if(
190
-              .Platform$OS.type == "unix" && Sys.info()["sysname"] != "Darwin"
191
-          ) c(
192
-              "AnVIL" = "https://bioconductordocker.blob.core.windows.net/packages/3.17/bioc",
193
-              BiocManager::repositories()
194
-              ) else BiocManager::repositories()
195
-
196 159
           ## For running the checks
197 160
           message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****'))
198
-          install.packages(c("rcmdcheck", "BiocCheck"), repos = gha_repos)
161
+          install.packages(c("rcmdcheck", "BiocCheck"), repos = BiocManager::repositories())
199 162
 
200 163
           ## Pass #1 at installing dependencies
201
-          ## This pass uses AnVIL-powered fast binaries
202
-          ## details at https://github.com/nturaga/bioc2021-bioconductor-binaries
203
-          ## The speed gains only apply to the docker builds.
204 164
           message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****'))
205
-          remotes::install_local(dependencies = TRUE, repos = gha_repos, build_vignettes = FALSE, upgrade = TRUE)
165
+          remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = FALSE, upgrade = TRUE)
206 166
         continue-on-error: true
207 167
         shell: Rscript {0}
208 168
 
209 169
       - name: Install dependencies pass 2
210 170
         run: |
211 171
           ## Pass #2 at installing dependencies
212
-          ## This pass does not use AnVIL and will thus update any packages
213
-          ## that have seen been updated in Bioconductor
214 172
           message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****'))
215 173
           remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE, force = TRUE)
216 174
         shell: Rscript {0}
... ...
@@ -274,7 +232,6 @@ jobs:
274 232
               dir('check', 'tar.gz$', full.names = TRUE),
275 233
               `quit-with-status` = TRUE,
276 234
               `no-check-R-ver` = TRUE,
277
-              `no-check-pkg-size` = TRUE,
278 235
               `no-check-bioc-help` = TRUE
279 236
           )
280 237
         shell: Rscript {0}
... ...
@@ -282,7 +239,7 @@ jobs:
282 239
       - name: Test coverage
283 240
         if: github.ref == 'refs/heads/devel' && env.run_covr == 'true' && runner.os == 'Linux'
284 241
         run: |
285
-          covr::codecov()
242
+          covr::codecov(coverage = covr::package_coverage(type = "all"))
286 243
         shell: Rscript {0}
287 244
 
288 245
       - name: Install package
... ...
@@ -315,6 +272,54 @@ jobs:
315 272
         if: failure()
316 273
         uses: actions/upload-artifact@master
317 274
         with:
318
-          name: ${{ runner.os }}-biocversion-RELEASE_3_17-r-4.3-results
275
+          name: ${{ runner.os }}-biocversion-RELEASE_3_19-r-4.4-results
319 276
           path: check
320 277
 
278
+
279
+  ## Code adapted from
280
+  ## https://github.com/waldronlab/cBioPortalData/blob/e0440a4445f0cc731e426363a76faa22ee5e0f9d/.github/workflows/devel_check_dock.yml#L65-L92
281
+  docker-build-and-push:
282
+    runs-on: ubuntu-latest
283
+    needs: build-check
284
+    steps:
285
+      - name: Checkout Repository
286
+        if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
287
+        uses: actions/checkout@v3
288
+
289
+      - name: Register repo name
290
+        if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
291
+        id: reg_repo_name
292
+        run: |
293
+          echo CONT_IMG_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
294
+
295
+      - name: Set up QEMU
296
+        if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
297
+        uses: docker/setup-qemu-action@v2
298
+
299
+      - name: Set up Docker Buildx
300
+        if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
301
+        uses: docker/setup-buildx-action@v2
302
+
303
+      - name: Login to Docker Hub
304
+        if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
305
+        uses: docker/login-action@v2
306
+        with:
307
+          username: ${{ secrets.DOCKERHUB_USERNAME }}
308
+          password: ${{ secrets.DOCKERHUB_TOKEN }}
309
+      ## Note that DOCKERHUB_TOKEN is really a token for your dockerhub
310
+      ## account, not your actual dockerhub account password. You can get it
311
+      ## from https://hub.docker.com/settings/security.
312
+      ## Check https://github.com/docker/build-push-action/tree/v4.0.0
313
+      ## for more details.
314
+      ## Alternatively, try checking
315
+      ## https://seandavi.github.io/BuildABiocWorkshop/articles/HOWTO_BUILD_WORKSHOP.html.
316
+
317
+      - name: Build and Push Docker
318
+        if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel' && success()"
319
+        uses: docker/build-push-action@v4
320
+        with:
321
+          context: .
322
+          push: true
323
+          tags: >
324
+            ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.CONT_IMG_NAME }}:latest,
325
+            ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.CONT_IMG_NAME }}:devel