-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
47 lines (41 loc) · 1.69 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: 'Find unused Julia project dependencies'
description: 'Run a given test to see if any project dependencies are unused'
author: 'Ian Butterworth'
branding:
icon: 'aperture'
color: 'gray-dark'
inputs:
test_code:
description: 'Code to run while evaluating dependency usage'
default: 'import Pkg; Pkg.test(julia_args=["--code-coverage=user"])'
required: false
prefix:
description: 'Value inserted in front of the julia command, e.g. for running xvfb-run julia [...]'
default: ''
required: false
project:
description: 'Value passed to the --project flag. The default value is the repository root: "@."'
default: '@.'
required: false
fail_unused_direct_deps:
description: 'Whether to fail the run if unused direct dependencies ar found. Default value: yes'
default: 'yes'
required: false
fail_unused_indirect_deps:
description: 'Whether to fail the run if unused direct dependencies ar found. Default value: no'
default: 'no'
required: false
runs:
using: 'composite'
steps:
- run: |
# The Julia command that will be executed
julia_cmd=( julia --code-coverage=user --color=yes --project=${{ inputs.project }} -e '${{ inputs.test_code }}' )
# Add the prefix in front of the command if there is one
prefix="${{ inputs.prefix }}"
[[ -n $prefix ]] && julia_cmd=( "$prefix" "${julia_cmd[@]}" )
# Run the Julia command
"${julia_cmd[@]}"
shell: bash
- run: julia --color=yes --project=${{ inputs.project }} "$GITHUB_ACTION_PATH"/treeshake.jl --fail_unused_direct=${{ inputs.fail_unused_direct_deps }} --fail_unused_indirect=${{ inputs.fail_unused_indirect_deps }}
shell: bash