Skip to content

Commit deb06f2

Browse files
committed
Unit tests
1 parent 169296d commit deb06f2

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,39 @@ jobs:
149149
version_tag_numeric: ${{ steps.version_bumped_gitlog_major.outputs.version_tag_numeric }}
150150
version_tag: ${{ steps.version_bumped_gitlog_major.outputs.version_tag }}
151151

152+
###########################################################################################
153+
154+
- name: merge a feat/ branch but with merge commit bump DISABLED
155+
run: |
156+
git config user.name "GitHub Actions Bot"
157+
git config user.email "<>"
158+
git branch feat/no-bump-test
159+
git switch feat/no-bump-test
160+
touch no-bump-test
161+
echo 'no-bump-test' > no-bump-test
162+
git add no-bump-test
163+
git commit -m "feat: no-bump-test"
164+
git checkout main
165+
git merge feat/no-bump-test --no-ff --commit --no-edit
166+
167+
- name: bump should be patch (1.0.1) NOT minor (1.1.0) because merge bump is disabled
168+
id: version_no_merge_bump
169+
run: ./version-bump.sh
170+
env:
171+
GHA_TAG: latest
172+
GHA_ENABLE_MERGE_COMMIT_BUMP: "false"
173+
174+
- name: test that 1.0.0 has bumped to 1.0.1 (patch) and NOT 1.1.0 (minor)
175+
run: |
176+
if [[ "$version_tag_numeric" == '1.0.1' ]];then
177+
echo "winning"
178+
else
179+
echo "Expected 1.0.1 but got $version_tag_numeric"
180+
exit 1
181+
fi
182+
shell: bash
183+
env:
184+
version_tag_numeric: ${{ steps.version_no_merge_bump.outputs.version_tag_numeric }}
185+
152186
###########################################################################################
153187

0 commit comments

Comments
 (0)