-
-
Notifications
You must be signed in to change notification settings - Fork 1
108 lines (105 loc) · 3.46 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
name: Test sync-release-version
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: shellcheck
uses: reviewdog/action-shellcheck@v1.19
- name: Sync release Version
uses: ./
id: sync-release-version
with:
current_version: 'v1.0.1'
new_version: 'v1.0.2'
paths: |
test/README.md
test/subdir/README.md
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v19
id: changed_files
with:
files: |
test/README.md
test/subdir/README.md
- name: Validate files changed.
if: steps.changed_files.outputs.files_changed != 'true'
run: |
echo "Expected versions changes."
echo "Found: \n"
cat test/README.md
echo "------"
cat test/subdir/README.md
exit 1
- name: Validate old_version output.
if: steps.sync-release-version.outputs.old_version != 'v1.0.1'
run: |
echo "Invalid previous version ${{ steps.sync-release-version.outputs.old_version }}: Expected v1.0.1"
exit 1
- name: Validate new_version output.
if: steps.sync-release-version.outputs.new_version != 'v1.0.2'
run: |
echo "Invalid new version ${{ steps.sync-release-version.outputs.new_version }}: Expected v1.0.2"
exit 1
- name: Show file changes
run: |
echo "test/README.md"
cat test/README.md
echo "test/subdir/README.md"
cat test/subdir/README.md
- name: Sync release Version Major
uses: ./
id: sync-release-version-major
with:
current_version: 'v1.0.1'
new_version: 'v2.0.0'
only_major: true
paths: |
test/README.md
test/subdir/README.md
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v19
id: changed_files_major
with:
files: |
test/README.md
test/subdir/README.md
- name: Validate files changed.
if: steps.changed_files_major.outputs.files_changed != 'true'
run: |
echo "Expected versions changes."
echo "Found: \n"
cat test/README.md
echo "------"
cat test/subdir/README.md
exit 1
- name: Validate old_version output.
if: steps.sync-release-version-major.outputs.old_version != 'v1.0.1'
run: |
echo "Invalid previous version ${{ steps.sync-release-version-major.outputs.old_version }}: Expected v1.0.1"
exit 1
- name: Validate new_version output.
if: steps.sync-release-version-major.outputs.new_version != 'v2'
run: |
echo "Invalid new version ${{ steps.sync-release-version-major.outputs.new_version }}: Expected v2"
exit 1
- name: Validate major_update output
if: steps.sync-release-version-major.outputs.major_update != 'true'
run: |
echo "Invalid major_update output ${{ steps.sync-release-version-major.outputs.major_update }}: Expected true"
exit 1
- name: Show file changes
run: |
echo "test/README.md"
cat test/README.md
echo "test/subdir/README.md"
cat test/subdir/README.md