Draft implementation of new SPR distance (#175) #1178
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
| # For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. | |
| # https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions | |
| on: | |
| schedule: | |
| - cron: "24 06 * * 1" | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| paths-ignore: | |
| - "Meta**" | |
| - "memcheck**" | |
| - "docs**" | |
| - "**.git" | |
| - "**.json" | |
| - "**.md" | |
| - "**.yaml" | |
| - "**.yml" | |
| - "!**R-CMD-check.yml" | |
| - "**.R[dD]ata" | |
| - "**.Rpro*" | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| paths-ignore: | |
| - "Meta**" | |
| - "memcheck**" | |
| - "docs**" | |
| - "**.git" | |
| - "**.json" | |
| - "**.md" | |
| - "**.yaml" | |
| - "**.yml" | |
| - "!**R-CMD-check.yml" | |
| - "**.R[dD]ata" | |
| - "**.Rpro*" | |
| name: R-CMD-check | |
| jobs: | |
| check-release: | |
| runs-on: ubuntu-24.04 | |
| name: ubuntu-24.04 (release) | |
| env: | |
| _R_CHECK_CRAN_INCOMING_: true # Seemingly not set by --as-cran | |
| _R_CHECK_FORCE_SUGGESTS_: false # CRAN settings | |
| R_COMPILE_AND_INSTALL_PACKAGES: 'never' | |
| _R_CHECK_THINGS_IN_CHECK_DIR_: false | |
| R_REMOTES_STANDALONE: true | |
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
| RSPM: "https://packagemanager.posit.co/cran/__linux__/noble/latest" | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout git repo | |
| uses: actions/checkout@v5 | |
| - name: Temporarily bump package version | |
| run: | | |
| old_version=$(grep "Version:" DESCRIPTION | awk '{print $2}') | |
| if [[ $(echo "$old_version" | tr -cd '.' | wc -c) -eq 2 ]]; then | |
| new_version="${old_version}.8888" | |
| if [[ "$RUNNER_OS" == "macOS" ]]; then | |
| sed -i "" "s/Version: .*/Version: ${new_version}/" DESCRIPTION | |
| else | |
| sed -i "s/Version: .*/Version: ${new_version}/" DESCRIPTION | |
| fi | |
| fi | |
| shell: bash | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| - name: Set up R dependencies | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: | | |
| ms609/TreeDistData | |
| needs: | | |
| check | |
| - name: Check package | |
| uses: r-lib/actions/check-r-package@v2 | |
| check-all: | |
| runs-on: ${{ matrix.config.os }} | |
| name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - {os: windows-latest, r: "release"} | |
| - {os: macos-15-intel, r: "release"} # Until Intel architecture retired 2027-11 | |
| - {os: macOS-latest, r: "release"} | |
| - {os: ubuntu-22.04, r: '4.1', rspm: "https://packagemanager.posit.co/cran/__linux__/jammy/latest"} | |
| - {os: ubuntu-24.04-arm, r: "release", rspm: "https://packagemanager.posit.co/cran/__linux__/noble/latest"} | |
| - {os: ubuntu-24.04, r: "devel", rspm: "https://packagemanager.posit.co/cran/__linux__/noble/latest"} | |
| env: | |
| _R_CHECK_CRAN_INCOMING_: ${{ github.event_name == 'pull_request' }} | |
| _R_CHECK_FORCE_SUGGESTS_: false # CRAN settings | |
| R_COMPILE_AND_INSTALL_PACKAGES: 'never' | |
| _R_CHECK_THINGS_IN_CHECK_DIR_: false | |
| R_REMOTES_STANDALONE: true | |
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
| R_REALLY_FORCE_SYMBOLS: true # Until R4.3 | |
| RSPM: ${{ matrix.config.rspm }} | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout git repo | |
| uses: actions/checkout@v5 | |
| - name: Temporarily bump package version | |
| run: | | |
| old_version=$(grep "Version:" DESCRIPTION | awk '{print $2}') | |
| if [[ $(echo "$old_version" | tr -cd '.' | wc -c) -eq 2 ]]; then | |
| new_version="${old_version}.8888" | |
| if [[ "$RUNNER_OS" == "macOS" ]]; then | |
| sed -i "" "s/Version: .*/Version: ${new_version}/" DESCRIPTION | |
| else | |
| sed -i "s/Version: .*/Version: ${new_version}/" DESCRIPTION | |
| fi | |
| fi | |
| shell: bash | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.config.r }} | |
| extra-repositories: https://ms609.github.io/packages/ | |
| - name: Set up R dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: | | |
| ms609/TreeDistData | |
| needs: | | |
| check | |
| coverage | |
| - name: Set up R dependencies (Non-Windows) | |
| if: runner.os != 'Windows' | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: | | |
| ms609/TreeDistData | |
| phangorn=?ignore-before-r=4.4.0 | |
| ggplot2=?ignore-before-r=4.4.0 | |
| hypervolume=?ignore-before-r=4.4.0 | |
| kdensity=?ignore-before-r=4.4.0 | |
| Rogue=?ignore-before-r=4.4.0 | |
| TreeSearch=?ignore-before-r=4.4.0 | |
| Umatrix=?ignore-before-r=4.4.0 | |
| uwot=?ignore-before-r=4.4.0 | |
| needs: | | |
| check | |
| - name: Check package | |
| uses: r-lib/actions/check-r-package@v2 | |
| - name: Code coverage | |
| if: runner.os == 'Windows' | |
| run: covr::codecov() | |
| shell: Rscript {0} | |
| - name: Notify on failure | |
| if: failure() && github.event_name == 'schedule' | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const issue_number = 164; | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue_number, | |
| per_page: 3 | |
| }); | |
| const oneHourAgo = new Date(Date.now() - 60 * 60 * 1000); | |
| const recentFailureNotified = comments.some(comment => | |
| new Date(comment.created_at) > oneHourAgo && | |
| comment.body.includes('Scheduled workflow has failed') | |
| ); | |
| if (recentFailureNotified) { | |
| console.log("Recently notified; don't bombard"); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue_number, | |
| body: 'Scheduled workflow has failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
| }); | |
| await github.rest.issues.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue_number, | |
| state: 'open' | |
| }); | |
| } | |
| rev-dep-check: | |
| runs-on: ubuntu-latest | |
| needs: check-release | |
| name: revdepcheck | |
| env: | |
| R_COMPILE_AND_INSTALL_PACKAGES: 'never' | |
| R_REMOTES_STANDALONE: true | |
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
| RSPM: ${{ matrix.config.rspm }} | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: ms609/actions/revdepcheck@main | |
| with: | |
| deps: ${{ matrix.config.deps }} | |
| extra-packages: ms609/TreeDistData |