From b814ef2d88ae8fad69fec21d0d80d19ce72d5812 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Sun, 1 Jan 2023 18:53:10 +0100 Subject: [PATCH] Add unit tests --- .github/workflows/ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 535a2eb..e22b721 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,12 @@ jobs: echo "Timestamp: ${{ steps.previoustag.outputs.timestamp }}" test -n "${{ steps.previoustag.outputs.tag }}" test -n "${{ steps.previoustag.outputs.timestamp }}" + - name: Assert we got the tag + uses: therussiankid92/gat@v1 + with: + assertion: should.equal + expected: v1 + actual: ${{ steps.previoustag.outputs.tag }} - name: Add tag with prefix run: | git tag tag-with-prefix-v1.0.0 @@ -44,6 +50,12 @@ jobs: uses: JesseTG/rm@v1.0.2 with: path: .git/refs/tags + - name: Assert we got the tag with the expected prefix + uses: therussiankid92/gat@v1 + with: + assertion: should.equal + expected: tag-with-prefix-v1.0.0 + actual: ${{ steps.previoustagwithprefix.outputs.tag }} - name: 'Get Previous tag with fallback' id: previoustagwithfallback uses: ./ @@ -54,3 +66,9 @@ jobs: echo "Timestamp: ${{ steps.previoustagwithfallback.outputs.timestamp }}" test -n "${{ steps.previoustagwithfallback.outputs.tag }}" test -n "${{ steps.previoustagwithfallback.outputs.timestamp }}" + - name: Assert we got the fallback + uses: therussiankid92/gat@v1 + with: + assertion: should.equal + expected: v1.0.0 + actual: ${{ steps.previoustagwithfallback.outputs.tag }}