diff --git a/.github/dep-suggests-matrix.json b/.github/dep-suggests-matrix.json deleted file mode 100644 index e69de29b..00000000 diff --git a/.github/versions-matrix.json b/.github/versions-matrix.json deleted file mode 100644 index a231d039..00000000 --- a/.github/versions-matrix.json +++ /dev/null @@ -1 +0,0 @@ -{"include":[{"os":"macos-latest","r":"4.4"},{"os":"macos-latest","r":"4.3"},{"os":"windows-latest","r":"devel"},{"os":"windows-latest","r":"4.4"},{"os":"windows-latest","r":"4.3"},{"os":"ubuntu-22.04","r":"devel","http-user-agent":"release"},{"os":"ubuntu-22.04","r":"4.4"},{"os":"ubuntu-22.04","r":"4.3"},{"os":"ubuntu-22.04","r":"4.2"},{"os":"ubuntu-22.04","r":"4.1"},{"os":"ubuntu-22.04","r":"4.0"},{"os":"ubuntu-22.04","r":"4.4","covr":"true","desc":"with covr"},{"os":"macos-latest","r":"release","mysql_client":"false","RMARIADB_FORCE_MARIADBCONFIG":"1","RMARIADB_FORCE_MYSQLCONFIG":"NA","mysql_server":"NA","desc":"mariadb_config"},{"os":"macos-latest","r":"release","mysql_client":"true","RMARIADB_FORCE_MARIADBCONFIG":"NA","RMARIADB_FORCE_MYSQLCONFIG":"1","mysql_server":"NA","desc":"mysql_config"},{"os":"ubuntu-22.04","r":"release","mysql_client":"true","RMARIADB_FORCE_MARIADBCONFIG":"NA","RMARIADB_FORCE_MYSQLCONFIG":"NA","mysql_server":"true","desc":"MySQL server"},{"os":"ubuntu-22.04","r":"release","mysql_client":"true","RMARIADB_FORCE_MARIADBCONFIG":"NA","RMARIADB_FORCE_MYSQLCONFIG":"NA","mysql_server":"false","desc":"MariaDB server, MySQL client"},{"os":"ubuntu-22.04","r":"release","mysql_client":"false","RMARIADB_FORCE_MARIADBCONFIG":"NA","RMARIADB_FORCE_MYSQLCONFIG":"NA","mysql_server":"true","desc":"MySQL server, MariaDB client"},{"os":"ubuntu-22.04","r":"release","mysql_client":"false","RMARIADB_FORCE_MARIADBCONFIG":"NA","RMARIADB_FORCE_MYSQLCONFIG":"NA","mysql_server":"false","desc":"MariaDB server + client"}]} diff --git a/.github/workflows/R-CMD-check-status.yaml b/.github/workflows/R-CMD-check-status.yaml index 15860acb..b9bdf4e4 100644 --- a/.github/workflows/R-CMD-check-status.yaml +++ b/.github/workflows/R-CMD-check-status.yaml @@ -16,11 +16,10 @@ jobs: name: "Update commit status" - # Only run if triggered by rcc workflow - if: github.event.workflow_run.name == 'rcc' - steps: - name: "Update commit status" + # Only run if triggered by rcc workflow + if: github.event.workflow_run.name == 'rcc' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 428cec13..2af0024c 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -18,9 +18,17 @@ on: workflow_dispatch: inputs: ref: - description: "Branch or tag to check out" + description: "Branch, tag, or commit to check out" required: false default: "main" + versions-matrix: + description: "Create a matrix of R versions" + type: boolean + default: false + dep-suggests-matrix: + description: "Create a matrix of suggested dependencies" + type: boolean + default: false merge_group: types: - checks_requested @@ -51,6 +59,38 @@ jobs: with: ref: ${{ inputs.ref }} + - name: Update status for rcc + # FIXME: Wrap into action + if: github.event_name == 'workflow_dispatch' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Check status of this workflow + state="pending" + sha=${{ inputs.ref }} + if [ -z "${sha}" ]; then + sha=${{ github.head_ref }} + fi + if [ -z "${sha}" ]; then + sha=${{ github.sha }} + fi + sha=$(git rev-parse ${sha}) + + html_url=$(gh api \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq -r .html_url) + + description="${{ github.workflow }} / ${{ github.job }}" + + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + repos/${{ github.repository }}/statuses/${sha} \ + -f "state=${state}" -f "target_url=${html_url}" -f "description=${description}" -f "context=rcc" + shell: bash + - uses: ./.github/workflows/rate-limit with: token: ${{ secrets.GITHUB_TOKEN }} @@ -66,25 +106,29 @@ jobs: cache-version: rcc-smoke-2 needs: check, website # Beware of using dev pkgdown here, has brought in dev dependencies in the past - extra-packages: any::rcmdcheck r-lib/roxygen2 any::decor r-lib/styler pkgdown deps::. + extra-packages: any::rcmdcheck r-lib/roxygen2 any::decor r-lib/styler r-lib/pkgdown deps::. - name: Install package run: | - R CMD INSTALL . + _R_SHLIB_STRIP_=true R CMD INSTALL . shell: bash - uses: ./.github/workflows/custom/after-install if: hashFiles('.github/workflows/custom/after-install/action.yml') != '' - id: versions-matrix - # Only run for pull requests if the base repo is different from the head repo, always run for other events - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository + # Only run for pull requests if the base repo is different from the head repo, not for workflow_dispatch if not requested, always run for other events + if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository) && (github.event_name != 'workflow_dispatch' || inputs.versions-matrix) uses: ./.github/workflows/versions-matrix - id: dep-suggests-matrix + # Not for workflow_dispatch if not requested, always run for other events + if: github.event_name != 'workflow_dispatch' || inputs.dep-suggests-matrix uses: ./.github/workflows/dep-suggests-matrix - uses: ./.github/workflows/update-snapshots + with: + base: ${{ inputs.ref || github.head_ref }} - uses: ./.github/workflows/style @@ -120,6 +164,46 @@ jobs: name: rcc-smoke-sha path: rcc-smoke-sha.txt + - name: Update status for rcc + # FIXME: Wrap into action + if: always() && github.event_name == 'workflow_dispatch' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Check status of this workflow + if [ "${{ job.status }}" == "success" ]; then + state="success" + else + state="failure" + fi + + sha=${{ steps.commit.outputs.sha }} + if [ -z "${sha}" ]; then + sha=${{ inputs.ref }} + fi + if [ -z "${sha}" ]; then + sha=${{ github.head_ref }} + fi + if [ -z "${sha}" ]; then + sha=${{ github.sha }} + fi + sha=$(git rev-parse ${sha}) + + html_url=$(gh api \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq -r .html_url) + + description="${{ github.workflow }} / ${{ github.job }}" + + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + repos/${{ github.repository }}/statuses/${sha} \ + -f "state=${state}" -f "target_url=${html_url}" -f "description=${description}" -f "context=rcc" + shell: bash + rcc-smoke-check-matrix: runs-on: ubuntu-latest @@ -183,6 +267,8 @@ jobs: with: results: ${{ runner.os }}-r${{ matrix.r }} +# The status update is taken care of by R-CMD-check-status.yaml + rcc-suggests: needs: - rcc-smoke @@ -256,3 +342,5 @@ jobs: - uses: ./.github/workflows/check with: results: ${{ matrix.package }} + +# The status update is taken care of by R-CMD-check-status.yaml diff --git a/.github/workflows/fledge.yaml b/.github/workflows/fledge.yaml index d880c55d..02e9101f 100644 --- a/.github/workflows/fledge.yaml +++ b/.github/workflows/fledge.yaml @@ -43,7 +43,7 @@ jobs: env: FLEDGE_GHA_CI: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/install/action.yml b/.github/workflows/install/action.yml index 702aedab..263ddf3a 100644 --- a/.github/workflows/install/action.yml +++ b/.github/workflows/install/action.yml @@ -56,6 +56,9 @@ runs: echo "_R_CHECK_UNDOC_USE_ALL_NAMES_=true" | tee -a $GITHUB_ENV echo "_R_CHECK_URLS_SHOW_301_STATUS_=true" | tee -a $GITHUB_ENV echo "_R_CXX_USE_NO_REMAP_=true" | tee -a $GITHUB_ENV + # There is no way to disable recency and frequency checks when the incoming checks are run + # echo "_R_CHECK_CRAN_INCOMING_=true" | tee -a $GITHUB_ENV + echo "_R_CHECK_CRAN_INCOMING_SKIP_LARGE_VERSION_=true" | tee -a $GITHUB_ENV shell: bash - name: Set environment variables (non-Windows only) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 09dc0638..de69b149 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -42,7 +42,7 @@ jobs: install-r: false cache-version: pkgdown-2 needs: website - extra-packages: pkgdown local::. + extra-packages: r-lib/pkgdown local::. - uses: ./.github/workflows/custom/after-install if: hashFiles('.github/workflows/custom/after-install/action.yml') != '' diff --git a/.github/workflows/update-snapshots/action.yml b/.github/workflows/update-snapshots/action.yml index 6322dc15..5ee7e3ec 100644 --- a/.github/workflows/update-snapshots/action.yml +++ b/.github/workflows/update-snapshots/action.yml @@ -3,6 +3,11 @@ description: > This action will run `testthat::test_local()` for tests that seem to use snapshots, this is determined by reading and grepping the test files. If the tests are failing, snapshots are updated, and a pull request is opened. +inputs: + base: + description: "The base branch to create the pull request against." + required: false + default: "main" runs: using: "composite" @@ -67,8 +72,8 @@ runs: id: cpr uses: peter-evans/create-pull-request@v6 with: - base: ${{ github.head_ref }} - branch: snapshot-${{ github.ref_name }}-${{ github.job }}-${{ steps.matrix-desc.outputs.branch }} + base: ${{ inputs.base }} + branch: snapshot-${{ inputs.base }}-${{ github.job }}-${{ steps.matrix-desc.outputs.branch }} delete-branch: true title: "test: Snapshot updates for ${{ github.job }} (${{ steps.matrix-desc.outputs.text }})" body: "Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action${{ github.event.number && format(' for #{0}', github.event.number) || '' }}."