Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
^src\-
^src\.
CONTRIBUTING
AGENTS.md
README.md
^\.github
^\.lintr
Expand Down Expand Up @@ -34,3 +35,5 @@ revdep
^\.vs.*$
^\.vscode.*$
^CRAN-SUBMISSION$
^\.positai$
^\.claude$
127 changes: 127 additions & 0 deletions .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,130 @@ jobs:
with:
deps: ${{ matrix.config.deps }}
extra-packages: ms609/TreeDistData

benchmark:
runs-on: ubuntu-latest
needs: check-release
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
name: benchmark

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RSPM: "https://packagemanager.posit.co/cran/__linux__/noble/latest"
_R_CHECK_BUILD_VIGNETTES_: false
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_FORCE_SUGGESTS_: false
R_REMOTES_STANDALONE: true
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
R_REALLY_FORCE_SYMBOLS: true
PKG_CXXFLAGS: "-O3"

steps:
- name: Checkout PR branch
uses: actions/checkout@v5
with:
path: pr

- name: Checkout target branch
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.base.ref || 'main' }}
path: main

- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
extra-repositories: https://ms609.github.io/packages/

- name: Install R dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"hard"'
extra-packages: |
github::ms609/TreeTools
needs: benchmark

- name: Benchmark PR
uses: ms609/actions/benchmark-step@main
with:
path: pr
output: pr

- name: Benchmark target
uses: ms609/actions/benchmark-step@main
with:
path: main
output: main

- name: Benchmark PR again
uses: ms609/actions/benchmark-step@main
with:
path: pr
output: pr2

- run: dir pr-benchmark-results
working-directory: pr
- run: dir main-benchmark-results
working-directory: pr

- name: Compare benchmarks
id: compare_results
working-directory: pr
run: |
Rscript benchmark/_compare_results.R
shell: bash

- name: Upload PR benchmark results
if: failure()
uses: actions/upload-artifact@v4
with:
name: pr-benchmark-results
path: pr/pr-benchmark-results/*.bench.Rds

- name: Upload main benchmark results
if: failure()
uses: actions/upload-artifact@v4
with:
name: main-benchmark-results
path: pr/main-benchmark-results/*.bench.Rds

- name: Comment on PR
if: always() && github.event_name == 'pull_request' && steps.compare_results.outputs.report != ''
uses: actions/github-script@v7
env:
BENCHMARK_MESSAGE: ${{ steps.compare_results.outputs.report }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const benchmarkIdentifier = '<!-- benchmark-comment -->';
const outdatedPrefix = '> **⚠️ This benchmark result is outdated. See the latest comment below.**\n\n';

const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});

const previousBenchmarkComments = comments.data.filter(comment =>
comment.user.type === 'Bot' &&
comment.body.includes(benchmarkIdentifier) &&
!comment.body.startsWith('> **⚠️ This benchmark result is outdated.')
);

for (const comment of previousBenchmarkComments) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id,
body: outdatedPrefix + comment.body
});
}

const newCommentBody = benchmarkIdentifier + '\n' + process.env.BENCHMARK_MESSAGE;

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: newCommentBody
});
125 changes: 0 additions & 125 deletions .github/workflows/benchmark.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .positai/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"permission": {
"read": {
"*.r": "allow",
"*.h": "allow",
"*.log": "allow",
"*.cpp": "allow",
"*.R": "allow",
"*": "allow"
},
"edit": {
"*.cpp": "allow",
"*.h": "allow",
"DESCRIPTION": "allow",
"src/Makevars": "allow",
"src/Makevars.win": "allow",
"*.R": "allow",
"*.md": "allow"
},
"bash": {
"cd C:/Users/pjjg18/GitHub/TreeDist": "allow",
"cat *": "allow",
"echo *": "allow",
"find *": "allow",
"grep *": "allow",
"head *": "allow",
"ls *": "allow",
"rm -f src/*.o src/*.dll": "allow",
"tail *": "allow"
}
}
}
Loading
Loading