Skip to content

Commit

Permalink
Avoid bare using Foo (#23)
Browse files Browse the repository at this point in the history
* Specifically install SnoopCompile v2

* Avoid bare `using Foo`

* Update action.yml

* Update action.yml

---------

Co-authored-by: Ian Butterworth <[email protected]>
  • Loading branch information
DilumAluthge and IanButterworth authored Jul 25, 2024
1 parent 26d4923 commit 8d25fc6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'Evaluate number of invalidations'

inputs:
test_script:
description: 'Script to test for invalidations. Defaults to `using Package`'
description: 'Script to test for invalidations. Defaults to `import Package`'
required: false
default: ''
package_name:
Expand Down Expand Up @@ -39,7 +39,7 @@ runs:
fi
echo "packagename=$PACKAGENAME" >> $GITHUB_OUTPUT
if [[ '${{ inputs.test_script }}' == '' ]]; then
TESTSCRIPT="using ${PACKAGENAME}"
TESTSCRIPT="import ${PACKAGENAME}"
else
TESTSCRIPT="${{ inputs.test_script }}"
fi
Expand All @@ -59,18 +59,18 @@ runs:
- name: Load package on branch
id: invs
run: |
using SnoopCompileCore
using SnoopCompileCore: @snoopr
invalidations = @snoopr begin ${{ steps.info.outputs.testscript }} end
using SnoopCompile
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:
using PrettyTables # needed for `report_invalidations` to be defined
import PrettyTables # needed for `report_invalidations` to be defined
SnoopCompile.report_invalidations(;
invalidations,
process_filename = x -> last(split(x, ".julia/packages/")),
Expand Down

0 comments on commit 8d25fc6

Please sign in to comment.