forked from actions/checkout
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test fetch-tags option in an actual workflow
- Loading branch information
1 parent
b896fd2
commit f2e2167
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Test fetch-tags | ||
|
||
on: | ||
push: | ||
branches: | ||
- add-fetch-tags-option-staging-test | ||
|
||
jobs: | ||
test-fetch-tags: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: AutoModality/action-clean@v1.1.0 | ||
- name: 1. Checkout without options | ||
uses: RobertWieczoreck/checkout@add-fetch-tags-option | ||
- name: 1. Expect no tags | ||
run: | | ||
tagCount=$(git tag | wc -l) | ||
if [[ $tagCount != 0 ]]; then | ||
echo "$tagCount tags found - 0 expected!" && exit 1 | ||
fi | ||
- uses: AutoModality/action-clean@v1.1.0 | ||
- name: 2. Checkout with fetch-depth=0 and fetch-tags=false (default) | ||
uses: RobertWieczoreck/checkout@add-fetch-tags-option | ||
with: | ||
fetch-depth: 0 | ||
- name: 2. Expect all tags | ||
run: | | ||
tagCount=$(git tag | wc -l) | ||
if [[ $tagCount != 29 ]]; then | ||
echo "$tagCount tags found - 29 expected!" && exit 1 | ||
fi | ||
- uses: AutoModality/action-clean@v1.1.0 | ||
- name: 3. Checkout with fetch-depth=0 and fetch-tags=true | ||
uses: RobertWieczoreck/checkout@add-fetch-tags-option | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
- name: 3. Expect all tags | ||
run: | | ||
tagCount=$(git tag | wc -l) | ||
if [[ $tagCount != 29 ]]; then | ||
echo "$tagCount tags found - 29 expected!" && exit 1 | ||
fi | ||
- uses: AutoModality/action-clean@v1.1.0 | ||
- name: 4. Checkout with fetch-depth=10 and fetch-tags=false | ||
uses: RobertWieczoreck/checkout@add-fetch-tags-option | ||
with: | ||
fetch-depth: 10 | ||
fetch-tags: false | ||
- name: 4. Expect no tags | ||
run: | | ||
tagCount=$(git tag | wc -l) | ||
if [[ $tagCount != 0 ]]; then | ||
echo "$tagCount tags found - 0 expected!" && exit 1 | ||
fi | ||
- uses: AutoModality/action-clean@v1.1.0 | ||
- name: 5. Checkout with fetch-depth=20 and fetch-tags=true | ||
uses: RobertWieczoreck/checkout@add-fetch-tags-option | ||
with: | ||
fetch-depth: 20 | ||
fetch-tags: true | ||
- name: 5. Expect 3 tags | ||
run: | | ||
tagCount=$(git tag | wc -l) | ||
if [[ $tagCount != 3 ]]; then | ||
echo "$tagCount tags found - 3 expected!" && exit 1 | ||
fi |