-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (105 loc) · 2.97 KB
/
test-changelog-workflow.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
name: Test Changelog Workflow
on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight
workflow_dispatch:
push:
branches: [ master ]
tags:
- 'v1'
paths:
- 'action.yml'
- '.github/workflows/test-changelog-workflow.yml'
pull_request:
branches: [ master ]
paths:
- 'action.yml'
- '.github/workflows/test-changelog-workflow.yml'
jobs:
test-default-parameters:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Test Default Parameters
uses: Reloaded-Project/devops-changelog@v1
- name: Assert Changelog File Existence
shell: bash
run: |
if [ ! -f "CHANGELOG.md" ]; then
echo "CHANGELOG.md file does not exist"
exit 1
fi
- name: Assert Changelog File Not Empty
shell: bash
run: |
if [ ! -s "CHANGELOG.md" ]; then
echo "CHANGELOG.md file is empty"
exit 1
fi
test-custom-parameters:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Test Custom Parameters
uses: Reloaded-Project/devops-changelog@v1
with:
output: custom-changelog.md
unreleased: true
commit-limit: 10
sort-commits: date-desc
hide-credit: true
- name: Assert Custom Changelog File Existence
shell: bash
run: |
if [ ! -f "custom-changelog.md" ]; then
echo "custom-changelog.md file does not exist"
exit 1
fi
- name: Assert Custom Changelog File Not Empty
shell: bash
run: |
if [ ! -s "custom-changelog.md" ]; then
echo "custom-changelog.md file is empty"
exit 1
fi
test-upload-artifact:
runs-on: ubuntu-latest
steps:
- name: Generate Changelog
uses: Reloaded-Project/devops-changelog@v1
with:
upload-artifact: true
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: Changelog
- name: Assert Downloaded Artifact Not Empty
shell: bash
run: |
if [ ! -s "CHANGELOG.md" ]; then
echo "Downloaded CHANGELOG.md artifact is empty"
exit 1
fi
test-custom-artifact-name:
runs-on: ubuntu-latest
steps:
- name: Generate Changelog
uses: Reloaded-Project/devops-changelog@v1
with:
upload-artifact: true
artifact-name: Custom_Changelog
- name: Download Custom Artifact
uses: actions/download-artifact@v4
with:
name: Custom_Changelog
- name: Assert Downloaded Custom Artifact Not Empty
shell: bash
run: |
if [ ! -s "CHANGELOG.md" ]; then
echo "Downloaded custom CHANGELOG.md artifact is empty"
exit 1
fi