-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (65 loc) · 2.39 KB
/
it-override.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
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
name: IT Variable Override
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
it-action-feature-override:
env:
version_product_major: 1
version_product_minor: 2
version_product_patch: 3
name: Variable Override
runs-on: ubuntu-latest
steps:
- name: Checkout sources for fixtures
uses: actions/checkout@v3
- name: When we require to load all vars from a set of files with override flag
uses: zlatko-ms/envarfiles@main
with:
override: true
paths: |
./test/fixtures/integ/plain/override.properties
./test/fixtures/integ/json/override.json
./test/fixtures/integ/yaml/override.yaml
- name: Then the already exisiting variable values will be updated
run: |
# load assertion function
source ./test/shell/assertvariable.sh
# perform assertions
assertDefinedAndEqualTo "version_product_major" "2"
assertDefinedAndEqualTo "version_product_minor" "3"
assertDefinedAndEqualTo "version_product_patch" "4"
it-action-feature-no-override:
env:
version_product_major: 1
version_product_minor: 2
version_product_patch: 3
name: No Variable override
runs-on: ubuntu-latest
steps:
- name: Checkout sources for fixtures
uses: actions/checkout@v3
- name: When we require to load all vars from a set of files without override flag
uses: zlatko-ms/envarfiles@main
with:
paths: |
./test/fixtures/integ/plain/override.properties
./test/fixtures/integ/json/override.json
./test/fixtures/integ/yaml/override.yaml
./test/fixtures/integ/json/org.json
- name: Then the already exisiting variable values will not be updated
run: |
# load assertion function
source ./test/shell/assertvariable.sh
# perform assertions
assertDefinedAndEqualTo "version_product_major" "1"
assertDefinedAndEqualTo "version_product_minor" "2"
assertDefinedAndEqualTo "version_product_patch" "3"
- name: And newly discovered variables will be loaded
run: |
# load assertion function
source ./test/shell/assertvariable.sh
# perform assertions
assertDefinedAndEqualTo "version_product_lead" "someone"