-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
83 lines (76 loc) · 2.71 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: FAIR Data Pipeline Action
author: FAIR Data Pipeline
description: Adds full install of the FAIR Data Pipeline registry and Command Line Interface
inputs:
local_registry:
description: Location in which to install local registry
required: false
default: ''
local_data_store:
description: Location of local registry data
required: false
default: data_store
remote_registry:
description: Location in which to install remote registry
required: false
default: registry-rem
directory:
description: Location of FAIR project for initialisation relative to runner directory
required: false
default: ''
ref:
description: Reference to use for FAIR-CLI
required: false
default: latest
outputs:
fair-version:
description: "FAIR CLI installed version"
value: ${{ steps.fair-install.outputs.fair-version }}
runs:
using: "composite"
steps:
- name: Install Python
uses: actions/setup-python@v2
- name: Install Poetry
uses: Gr1N/setup-poetry@v7
- name: Install Required Modules
run: python -m pip install PyYAML
shell: bash
- name: Install FAIR CLI
id: fair-install
run: |
FAIR_BIN_DIR=$GITHUB_WORKSPACE/fair-cli/bin \
PROJECT_DIRECTORY=$GITHUB_WORKSPACE/${{ inputs.directory }} \
REMOTE_REGISTRY=$GITHUB_WORKSPACE/${{ inputs.remote_registry }} \
LOCAL_REGISTRY=$GITHUB_WORKSPACE/${{ inputs.local_registry }} \
LOCAL_DATA_STORE=$GITHUB_WORKSPACE/${{ inputs.local_data_store }} \
REFERENCE=${{ inputs.ref }} \
$GITHUB_ACTION_PATH/setup-fair-cli.sh
echo "::set-output name=fair-version::$(echo $FAIR_VERSION)"
shell: bash
- name: Update CLI Configs
run: |
echo "::notice title=CLI YAML Update::Updating local and global CLI configurations"
python $GITHUB_ACTION_PATH/update_cli_config.py \
$GITHUB_WORKSPACE/${{ inputs.local_registry }} \
$GITHUB_WORKSPACE/${{ inputs.remote_registry }} \
$GITHUB_WORKSPACE/${{ inputs.local_data_store }} \
$GITHUB_WORKSPACE/${{ inputs.directory }}/.fair/cli-config.yaml \
$HOME/.fair/cli/cli-config.yaml
echo "::endgroup::"
shell: bash
- name: Cache Project Setup
id: faircli-project-cache
uses: actions/cache@v2
with:
path: |
${{ inputs.directory }}/.fair/cli-config.yaml
${{ inputs.directory }}/config.yaml
${{ inputs.directory }}/.git
${{ inputs.local_registry }}
${{ inputs.remote_registry }}
${HOME}/.fair/cli/cli-config.yaml
key: faircli-${{ steps.fair-install.outputs.fair-version }}
branding:
icon: terminal
color: gray-dark