build_pkgdown.R: use withCallingHandlers to muffle and collect warnings (#4034) #10327
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker GHA | |
| env: | |
| DEFAULT_R_VERSION: 4.4 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| tags: | |
| - "v*.*.*" | |
| pull_request: | |
| merge_group: | |
| workflow_dispatch: | |
| inputs: | |
| r_version: | |
| description: 'R version to use' | |
| required: true | |
| type: choice | |
| default: "$DEFAULT_R_VERSION" | |
| options: | |
| - 4.2 | |
| - 4.3 | |
| - 4.4 | |
| - 4.5 | |
| - devel | |
| schedule: | |
| # 1:30 AM UTC, different R version each day | |
| - cron: '30 1 * * 1' # Rdevel | |
| - cron: '30 1 * * 2' # R4.2 | |
| - cron: '30 1 * * 3' # R4.3 | |
| - cron: '30 1 * * 4' # R4.4 | |
| - cron: '30 1 * * 5' # R4.5 | |
| jobs: | |
| # ---------------------------------------------------------------------- | |
| # Set R version. | |
| # This is a hack: We really just want a global env var here, but it seems | |
| # `env:` values can't be passed into a `jobs.<jobid>.with` context | |
| # (see https://github.com/actions/runner/issues/2372). | |
| # As an ugly workaround, we assign it to a job output instead. | |
| # ---------------------------------------------------------------------- | |
| rversion: | |
| # Every build job below needs this job, so gating it here skips the whole | |
| # push-based Docker stack for pull requests opened from forks. Forks get a | |
| # read-only GITHUB_TOKEN and cannot push to ghcr.io/pecanproject, so those | |
| # jobs always failed at the push step. Fork PRs are instead built (without | |
| # pushing) by docker-build-pr.yml. Non-fork events (push, merge_group, | |
| # schedule, workflow_dispatch) and same-repo PRs still run the full stack. | |
| if: >- | |
| github.event_name != 'pull_request' || | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: mon | |
| if: github.event.schedule == '30 1 * * 1' | |
| run: echo "R_VERSION=devel" >> "$GITHUB_OUTPUT" | |
| - id: tue | |
| if: github.event.schedule == '30 1 * * 2' | |
| run: echo "R_VERSION=4.2" >> "$GITHUB_OUTPUT" | |
| - id: wed | |
| if: github.event.schedule == '30 1 * * 3' | |
| run: echo "R_VERSION=4.3" >> "$GITHUB_OUTPUT" | |
| - id: thu | |
| if: github.event.schedule == '30 1 * * 4' | |
| run: echo "R_VERSION=4.4" >> "$GITHUB_OUTPUT" | |
| - id: fri | |
| if: github.event.schedule == '30 1 * * 5' | |
| run: echo "R_VERSION=4.5" >> "$GITHUB_OUTPUT" | |
| - id: default | |
| if: github.event_name != 'schedule' | |
| run: echo "R_VERSION=${{ github.event.inputs.r_version || env.DEFAULT_R_VERSION }}" >> "$GITHUB_OUTPUT" | |
| - id: platform | |
| # upstream rocker/tidyverse image is only on ARM for R 4.5.* (so far) | |
| shell: bash | |
| run: | | |
| if [[ "${{ join(steps.*.outputs.R_VERSION, '') }}" == "4.5" ]]; then | |
| echo "PLATFORMS=linux/amd64,linux/arm64" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "PLATFORMS=linux/amd64" >> "$GITHUB_OUTPUT" | |
| fi | |
| outputs: | |
| # Note: "steps.*" seems to mean "all step ids", not "all steps" | |
| # If seeing weird results here, check that all steps above have an id set. | |
| R_VERSION: ${{ join(steps.*.outputs.R_VERSION, '') }} | |
| PLATFORMS: ${{ join(steps.platform.outputs.PLATFORMS, '') }} | |
| # ---------------------------------------------------------------------- | |
| # depends image has all the dependencies installed | |
| # ---------------------------------------------------------------------- | |
| depends: | |
| permissions: | |
| packages: write | |
| needs: rversion | |
| uses: ./.github/workflows/docker-build-image.yml | |
| with: | |
| image-name: depends | |
| build-context: docker/depends | |
| dockerfile: docker/depends/Dockerfile | |
| r-version: ${{ needs.rversion.outputs.R_VERSION }} | |
| platforms: ${{ needs.rversion.outputs.PLATFORMS }} | |
| secrets: inherit | |
| # ---------------------------------------------------------------------- | |
| # base image has PEcAn compiled and installed, and depends on depends | |
| # ---------------------------------------------------------------------- | |
| base: | |
| needs: [rversion, depends] | |
| uses: ./.github/workflows/docker-build-image.yml | |
| with: | |
| image-name: base | |
| build-context: . | |
| dockerfile: docker/base/Dockerfile | |
| r-version: ${{ needs.rversion.outputs.R_VERSION }} | |
| parent-image: "depends" | |
| platforms: ${{ needs.rversion.outputs.PLATFORMS }} | |
| secrets: inherit | |
| # ---------------------------------------------------------------------- | |
| # models image has some python installed to run models, depends on base | |
| # ---------------------------------------------------------------------- | |
| models: | |
| needs: [rversion, base] | |
| uses: ./.github/workflows/docker-build-image.yml | |
| with: | |
| image-name: models | |
| build-context: docker/models | |
| dockerfile: docker/models/Dockerfile | |
| r-version: ${{ needs.rversion.outputs.R_VERSION }} | |
| parent-image: "base" | |
| platforms: ${{ needs.rversion.outputs.PLATFORMS }} | |
| secrets: inherit | |
| # ---------------------------------------------------------------------- | |
| # Next are images that have models installed | |
| # ---------------------------------------------------------------------- | |
| modelsbinary: | |
| needs: [rversion, models] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| name: | |
| - basgra | |
| - biocro | |
| # - ed2_2.2.0 | |
| - ed2_git | |
| - maespa | |
| - sipnet | |
| include: | |
| - name: basgra | |
| CONTEXT: models/basgra | |
| DOCKERFILE: models/basgra/Dockerfile | |
| MODEL: basgra | |
| VERSION: BASGRA_N_v1 | |
| - name: biocro | |
| CONTEXT: models/biocro | |
| DOCKERFILE: models/biocro/Dockerfile | |
| MODEL: biocro | |
| VERSION: "0.95" | |
| # - name: ed2_2.2.0 | |
| # CONTEXT: models/ed | |
| # DOCKERFILE: models/ed/Dockerfile | |
| # MODEL: ed2 | |
| # VERSION: "2.2.0" | |
| - name: ed2_git | |
| CONTEXT: models/ed | |
| DOCKERFILE: models/ed/Dockerfile | |
| MODEL: ed2 | |
| VERSION: "git" | |
| - name: maespa | |
| CONTEXT: models/maespa | |
| DOCKERFILE: models/maespa/Dockerfile | |
| MODEL: maespa | |
| VERSION: "git" | |
| - name: sipnet | |
| CONTEXT: models/sipnet | |
| DOCKERFILE: models/sipnet/Dockerfile | |
| MODEL: sipnet | |
| VERSION: "git" | |
| uses: ./.github/workflows/docker-build-image.yml | |
| with: | |
| image-name: model-${{ matrix.MODEL }}-${{ matrix.VERSION }} | |
| build-context: ${{ matrix.CONTEXT }} | |
| dockerfile: ${{ matrix.DOCKERFILE }} | |
| r-version: ${{ needs.rversion.outputs.R_VERSION }} | |
| parent-image: "models" | |
| model-version: ${{ matrix.VERSION }} | |
| platforms: ${{ needs.rversion.outputs.PLATFORMS }} | |
| secrets: inherit | |
| # ---------------------------------------------------------------------- | |
| # Next are images that depend on base image | |
| # ---------------------------------------------------------------------- | |
| baseplus: | |
| needs: [rversion, base] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| name: | |
| - docs | |
| - executor | |
| - api | |
| include: | |
| - name: docs | |
| CONTEXT: . | |
| DOCKERFILE: docker/docs/Dockerfile | |
| - name: executor | |
| CONTEXT: docker/executor | |
| DOCKERFILE: docker/executor/Dockerfile | |
| - name: api | |
| CONTEXT: apps/api | |
| DOCKERFILE: apps/api/Dockerfile | |
| uses: ./.github/workflows/docker-build-image.yml | |
| with: | |
| image-name: ${{ matrix.name }} | |
| build-context: ${{ matrix.CONTEXT }} | |
| dockerfile: ${{ matrix.DOCKERFILE }} | |
| r-version: ${{ needs.rversion.outputs.R_VERSION }} | |
| parent-image: "base" | |
| platforms: ${{ needs.rversion.outputs.PLATFORMS }} | |
| secrets: inherit | |
| # ---------------------------------------------------------------------- | |
| # Next are images that do not depend on either depends or base image | |
| # ---------------------------------------------------------------------- | |
| extras: | |
| needs: rversion | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| name: | |
| - web | |
| - shiny-dbsync | |
| - data | |
| - monitor | |
| - rstudio-nginx | |
| include: | |
| - name: web | |
| CONTEXT: . | |
| DOCKERFILE: docker/web/Dockerfile | |
| PLATFORM: "linux/amd64,linux/arm64" | |
| - name: shiny-dbsync | |
| CONTEXT: shiny/dbsync | |
| DOCKERFILE: shiny/dbsync/Dockerfile | |
| PLATFORM: "linux/amd64" | |
| - name: data | |
| CONTEXT: docker/data | |
| DOCKERFILE: docker/data/Dockerfile | |
| PLATFORM: "linux/amd64,linux/arm64" | |
| - name: monitor | |
| CONTEXT: docker/monitor | |
| DOCKERFILE: docker/monitor/Dockerfile | |
| PLATFORM: "linux/amd64,linux/arm64" | |
| - name: rstudio-nginx | |
| CONTEXT: docker/rstudio-nginx | |
| DOCKERFILE: docker/rstudio-nginx/Dockerfile | |
| PLATFORM: "linux/amd64,linux/arm64" | |
| uses: ./.github/workflows/docker-build-image.yml | |
| with: | |
| image-name: ${{ matrix.name }} | |
| build-context: ${{ matrix.CONTEXT }} | |
| dockerfile: ${{ matrix.DOCKERFILE }} | |
| platforms: ${{ matrix.PLATFORM }} | |
| r-version: ${{ needs.rversion.outputs.R_VERSION }} | |
| secrets: inherit |