Skip to content

Commit

Permalink
add unit test & tagbot
Browse files Browse the repository at this point in the history
  • Loading branch information
szcf-weiya committed Oct 17, 2024
1 parent 34ebc1b commit d26f9f2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
user: szcf-weiya
email: [email protected]
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
ssh: ${{ secrets.DOCUMENTER_KEY }}
12 changes: 12 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ end
@test 0 <= fdr < 0.2
@test 0.5 <= f1 <= 1.0

# with whitening
res = ds(x, q = 0.05, ret_ms = false, kmeans_whiten = true)
fdr, f1, prec, recall = calc_acc(res, truth)
@test 0 <= fdr < 0.2
@test 0.5 <= f1 <= 1.0

res = mds(x, M = 10, q = 0.05)
fdr, f1, prec, recall = calc_acc(res, truth)
@test 0 <= fdr < 0.2
Expand Down Expand Up @@ -78,3 +84,9 @@ end
@test 0 <= fdr < 0.2
@test 0.5 <= f1 <= 1.0
end

@testset "check pc" begin
a, b = first_two_PCs(randn(10, 4))
@test length(a) == length(b) == 10
@test sum(a.^2) > sum(b.^2)
end

2 comments on commit d26f9f2

@szcf-weiya
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/117448

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" d26f9f2c784798bf94d6c97392375aa8cdeb24ce
git push origin v0.1.0

Please sign in to comment.