-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
69 lines (58 loc) · 2 KB
/
action.yaml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--- # allow running scwrypts in Github Actions
name: scwrypts
author: yage
description: check required dependencies and run a scwrypt
inputs:
scwrypt:
description: "args / identifiers for scwrypts CLI (e.g. '--name <scwrypt-name> --group <group-name> --type <type-name>')"
required: true
args:
description: "arguments to pass to the scwrypt-to-be-run"
required: false
version:
description: "scwrypts version; defaults to latest (minimum v3.7.0)"
required: false
scwrypts-env:
description: "override value for SCWRYPTS_ENV"
required: false
default: "ci.github-actions"
runs:
using: composite
steps:
- uses: actions/checkout@v4
with:
repository: wrynegade/scwrypts
path: ./wrynegade/scwrypts
ref: ${{ inputs.version }}
fetch-tags: true
- name: check dependencies
shell: bash
env:
CI: true
SCWRYPTS_PLUGIN_ENABLED__ci: 1
run: |
[ $CI_SCWRYPTS_READY ] && [[ $CI_SCWRYPTS_READY -eq 1 ]] && echo 'setup completed previously' && exit 0
echo "updating package dependencies"
{
sudo apt-get update
sudo apt-get install --yes zsh fzf ripgrep
for D in $($GITHUB_WORKSPACE/wrynegade/scwrypts/scwrypts -n --name check-all-dependencies --group ci --type zsh)
do
echo "--- installing $D ---"
( sudo apt-get install --yes $D; exit 0; )
done
} > $HOME/.scwrypts.apt-get.log 2>&1
echo "updating virtual dependencies"
$GITHUB_WORKSPACE/wrynegade/scwrypts/scwrypts \
--name scwrypts/virtualenv/update-all \
--group scwrypts \
--type zsh \
> $HOME/.scwrypts.virtualenv.log 2>&1
echo "CI_SCWRYPTS_READY=1" >> $GITHUB_ENV
exit 0
- name: run scwrypt
shell: bash
env:
CI: true
SCWRYPTS_ENV: ${{ inputs.scwrypts-env }}
run: $GITHUB_WORKSPACE/wrynegade/scwrypts/scwrypts ${{inputs.scwrypt}} -- ${{inputs.args}} || exit 1