-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (128 loc) · 4.57 KB
/
test.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: test
on:
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: check some build related things
run: |
git --version
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git status
git diff
ls -la .
git tag -l
###########################################################################################
- name: specifically set a tag of v2.0.1
id: version
run: ./version-bump.sh
env:
GHA_TAG: v2.0.1
- name: test to see if the exact tag is returned
run: |
if [[ "$version_tag_numeric" == '2.0.1' ]];then
echo "winning"
else
exit 1
fi
shell: bash
env:
version_tag_numeric: ${{ steps.version.outputs.version_tag_numeric }}
version_tag: ${{ steps.version.outputs.version_tag }}
##########################################################################################
- name: specifically set a tag of v2.0.1 but check that the last version is 0.0.1
id: version_last
run: ./version-bump.sh
env:
GHA_TAG: v2.0.1
- name: test to see if the exact tag is returned
run: |
if [[ "$version_last_numeric" == '0.0.1' ]];then
echo "winning"
else
exit 1
fi
shell: bash
env:
version_last_numeric: ${{ steps.version_last.outputs.version_last_numeric }}
version_last: ${{ steps.version_last.outputs.version_last }}
###########################################################################################
- name: test to see if default patch bumping from the latest git tag of 0.0.1 works
id: version_bumped
run: ./version-bump.sh
env:
GHA_TAG: latest
- name: test if 0.0.1 is bumped to 0.0.2
run: |
if [[ "$version_tag_numeric" == '0.0.2' ]];then
echo "winning"
else
exit 1
fi
shell: bash
env:
version_tag_numeric: ${{ steps.version_bumped.outputs.version_tag_numeric }}
version_tag: ${{ steps.version_bumped.outputs.version_tag }}
###########################################################################################
- name: make a feat/ branch and merge into main to trigger a minor bump
run: |
git --version
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git branch feat/merge-test
git switch feat/merge-test
touch merge-test
echo 'merge-test' > merge-test
git add merge-test
git commit -m "merge-test"
git checkout main
git merge feat/merge-test --no-ff --commit --no-edit
git log
echo "-------------------"
git log --merges -n 1
- name: bump 0.0.1 to 0.1.0 due to the feat/ merge
id: version_bumped_gitlog_minor
run: ./version-bump.sh
env:
GHA_TAG: latest
- name: test that 0.0.1 has bumped to 0.1.0
run: |
if [[ "$version_tag_numeric" == '0.1.0' ]];then
echo "winning"
else
exit 1
fi
shell: bash
env:
version_tag_numeric: ${{ steps.version_bumped_gitlog_minor.outputs.version_tag_numeric }}
version_tag: ${{ steps.version_bumped_gitlog_minor.outputs.version_tag }}
###########################################################################################
- name: commit '#major' to the local git repo (no push)
run: |
git --version
git config user.name "GitHub Actions Bot"
git config user.email "<>"
touch wibble
echo 'bibble' > wibble
git add wibble
git commit -m '#major'
- name: bump 0.0.1 to 1.0.0 using the '#major' commit message
id: version_bumped_gitlog_major
run: ./version-bump.sh
env:
GHA_TAG: latest
- name: test that major bump has happened to 1.0.0
run: |
if [[ "$version_tag_numeric" == '1.0.0' ]];then
echo "winning"
else
exit 1
fi
shell: bash
env:
version_tag_numeric: ${{ steps.version_bumped_gitlog_major.outputs.version_tag_numeric }}
version_tag: ${{ steps.version_bumped_gitlog_major.outputs.version_tag }}
###########################################################################################