Skip to content

Replace deprecated set-output and use Julia shell #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2022
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}