Skip to content
Merged
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
23 changes: 19 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,34 @@ runs:
run: |
REPONAME="${{ github.event.repository.name }}"
PACKAGENAME=${REPONAME%.jl}
echo "::set-output name=packagename::$PACKAGENAME"
echo "packagename=$PACKAGENAME" >> $GITHUB_OUTPUT
if [[ '${{ inputs.test_script }}' == '' ]]; then
TESTSCRIPT="using ${PACKAGENAME}"
else
TESTSCRIPT=${{ inputs.test_script }}
fi
echo "::set-output name=testscript::$TESTSCRIPT"
echo "testscript=$TESTSCRIPT" >> $GITHUB_OUTPUT
shell: bash

- name: Install SnoopCompile tools
run: julia --project -e 'using Pkg; Pkg.add(["SnoopCompileCore", "SnoopCompile"])'
shell: bash
- name: Load package on branch
id: invs
run: julia --project -e 'using SnoopCompileCore; invalidations = @snoopr begin ${{ steps.info.outputs.testscript }} end; using SnoopCompile; 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; println("::set-output name=total::$(inv_total)"); println("::set-output name=deps::$(inv_deps)")'
shell: bash
run: |
using SnoopCompileCore
invalidations = @snoopr begin ${{ steps.info.outputs.testscript }} end

using SnoopCompile
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

# Set outputs
open(ENV["GITHUB_OUTPUT"], "a") do io
println(io, "total=$(inv_total)")
println(io, "deps=$(inv_deps)")'
end
shell: julia --color=yes --project=. {0}