mirror of
https://github.com/orhun/git-cliff.git
synced 2024-12-14 14:15:23 +03:00
53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
name: Test fixtures
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
test-fixtures:
|
|
name: Test fixtures
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set git config
|
|
run: |
|
|
git config --global user.name github-actions
|
|
git config --global user.email github-actions@github.com
|
|
- name: Create commits and tags
|
|
run: |
|
|
mkdir .workspace && cd .workspace && git init
|
|
git commit --allow-empty -m "Initial commit"
|
|
git commit --allow-empty -m "feat: add skip feature"
|
|
git tag v0.1.0-beta.1
|
|
git commit --allow-empty -m "feat: add feature 1"
|
|
git commit --allow-empty -m "feat: fix feature 1"
|
|
git tag v0.1.0
|
|
git commit --allow-empty -m "feat: add feature 2"
|
|
git tag v0.2.0-beta.1
|
|
git commit --allow-empty -m "feat: add feature 3"
|
|
git tag v0.2.0
|
|
env:
|
|
GIT_AUTHOR_DATE: "2021-01-23 01:23:45"
|
|
GIT_COMMITTER_DATE: "2021-01-23 01:23:45"
|
|
- name: Generate a changelog
|
|
run: |
|
|
cd .workspace
|
|
fixtures_dir=${GITHUB_WORKSPACE}/.github/fixtures
|
|
docker run -t \
|
|
-v "$(pwd)/.git":/app/ \
|
|
-v "$fixtures_dir/cliff.toml":/app/cliff.toml \
|
|
orhunp/git-cliff:latest > "$fixtures_dir/output.md"
|
|
- name: Compare the output with the expected output
|
|
run: |
|
|
cd ${GITHUB_WORKSPACE}/.github/fixtures
|
|
cat output.md
|
|
diff --strip-trailing-cr output.md expected.md
|