Skip to content

Test Changelog Workflow #89

Test Changelog Workflow

Test Changelog Workflow #89

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