Skip to content

Commit

Permalink
Bump to SnoopCompile v3 (#33)
Browse files Browse the repository at this point in the history
Closes #18
  • Loading branch information
timholy authored Nov 24, 2024
1 parent 8d25fc6 commit 8fc25a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# julia-invalidations
Uses [`SnoopCompile.@snoopr`](https://timholy.github.io/SnoopCompile.jl/v2/snoopr/)
Uses [`SnoopCompile.@snoop_invalidations`](https://timholy.github.io/SnoopCompile.jl/dev/tutorials/invalidations/)
to evaluate number of invalidations caused by `using Package` or a provided script.

Currently this action uses SnoopCompile v2.
In a future release, we will upgrade to SnoopCompile v3.


## Usage

This is a composite github action, that can be inserted into a github action on the target repo to evaluate number of invalidations
Expand Down
20 changes: 10 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ inputs:
type: number

outputs:
total:
total:
description: "Total number of invalidations"
value: ${{ steps.invs.outputs.total }}
deps:
deps:
description: "Number of invalidations caused by deps"
value: ${{ steps.invs.outputs.deps }}

runs:
using: "composite"
steps:
steps:
- name: Get package name
id: info
run: |
Expand All @@ -45,12 +45,12 @@ runs:
fi
echo "testscript=$TESTSCRIPT" >> $GITHUB_OUTPUT
shell: bash

- name: Install SnoopCompile tools
run: |
import Pkg;
pkgs = [
Pkg.PackageSpec(name = "SnoopCompile", version = "2", uuid = "aa65fe97-06da-5843-b5b1-d5d13cad87d2"),
Pkg.PackageSpec(name = "SnoopCompile", version = "3", uuid = "aa65fe97-06da-5843-b5b1-d5d13cad87d2"),
Pkg.PackageSpec(name = "SnoopCompileCore", uuid = "e2b509da-e806-4183-be48-004708413034"),
Pkg.PackageSpec(name = "PrettyTables", uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"),
]
Expand All @@ -59,14 +59,14 @@ runs:
- name: Load package on branch
id: invs
run: |
using SnoopCompileCore: @snoopr
invalidations = @snoopr begin ${{ steps.info.outputs.testscript }} end
using SnoopCompileCore: @snoop_invalidations
invalidations = @snoop_invalidations begin ${{ steps.info.outputs.testscript }} end
using SnoopCompile: SnoopCompile, filtermod, invalidation_trees, uinvalidated
inv_owned = length(filtermod(${{ steps.info.outputs.packagename }}, invalidation_trees(invalidations)))
inv_total = length(uinvalidated(invalidations))
inv_deps = inv_total - inv_owned
@show inv_total, inv_deps
# Report invalidations summary:
Expand All @@ -82,4 +82,4 @@ runs:
println(io, "total=$(inv_total)")
println(io, "deps=$(inv_deps)")
end
shell: julia --color=yes --project=. {0}
shell: julia --color=yes --project=. {0}

0 comments on commit 8fc25a5

Please sign in to comment.