-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
60 lines (50 loc) · 2.04 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
name: Tester
description: 'If a layer tester in a Dockerfile exists, the action will set up docker buildx for the tester Layer and runs the tests'
inputs:
TESTING_WITH_DB:
description: 'if set to true, testcontainer will be created and tests will be run in DB'
required: false
default: 'false'
ACTION_ENABLE_TESTING:
description: 'if set to true, testcontainer will be created and tests will be run'
required: false
default: 'false'
# env:
# ACTION_ENABLE_TESTING: ${{ inputs.ACTION_ENABLE_TESTING }}
# TESTING_WITH_DB: ${{ inputs.TESTING_WITH_DB }}
runs:
using: 'composite'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Display inputs
id: display_inputs
run: |
echo "${{inputs.ACTION_ENABLE_TESTING}} ${{inputs.TESTING_WITH_DB}}"
shell: bash
- name: Test if input has value 2.1
id: tester
if: ${{ inputs.ACTION_ENABLE_TESTING == '' }}
run: |
echo "2.1 ${{ inputs.ACTION_ENABLE_TESTING.default }}"
shell: bash
- name: Test if input has value 2.2
if: inputs.ACTION_ENABLE_TESTING == ''
run: |
echo "2.2 ${{ inputs.ACTION_ENABLE_TESTING.default }}"
shell: bash
- name: Test fromJson outcome false flase
if: ${{ !fromJSON(inputs.ACTION_ENABLE_TESTING.default) && !fromJSON(inputs.TESTING_WITH_DB.default) && steps.tester.outcome == 'success' }} || ${{ !fromJSON(inputs.ACTION_ENABLE_TESTING) && !fromJSON(inputs.TESTING_WITH_DB) }}
run: |
echo "3 if both false ${{inputs.ACTION_ENABLE_TESTING}} ${{inputs.TESTING_WITH_DB}}"
shell: bash
- name: Test fromJson outcome false flase
if: ${{ fromJSON(inputs.ACTION_ENABLE_TESTING) && fromJSON(inputs.TESTING_WITH_DB) }}
run: |
echo "4 if both true ${{inputs.ACTION_ENABLE_TESTING}} ${{inputs.TESTING_WITH_DB}}"
shell: bash
- name: Test fromJson outcome one true
if: ${{ fromJSON(inputs.ACTION_ENABLE_TESTING) || fromJSON(inputs.TESTING_WITH_DB) }}
run: |
echo "5 if one true ${{inputs.ACTION_ENABLE_TESTING}} ${{inputs.TESTING_WITH_DB}}"
shell: bash