From cb4540d134875b5b258e412e6dc0dbdd082da987 Mon Sep 17 00:00:00 2001 From: Phil Jay Date: Wed, 18 Oct 2023 23:43:15 +1100 Subject: [PATCH] Add testing for `use_api` --- .github/workflows/test-and-release.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 1a2bc92..be99be4 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -34,10 +34,36 @@ jobs: - name: Test run: bats tests/*.bats + test-api: + runs-on: ubuntu-latest + steps: + - name: Test lookup version (with API) + id: version-lookup + env: + use_api: 'true' + run: ./version-lookup.sh + + - name: Check lookup result + shell: bash + run: '[[ -n "${{ steps.version-lookup.outputs.CURRENT_VERSION }}" ]]' + + - name: Test increment version (with API) + id: version-increment + run: ./version-increment.sh + env: + current_version: ${{ steps.version-lookup.outputs.CURRENT_VERSION }} + scheme: calver + use_api: 'true' + + - name: Check increment result + shell: bash + run: '[[ "$(date +%Y.%m)" ~= "$(echo "${{ steps.version-increment.outputs.VERSION }}" | cut -d "." -f 1-2)" ]]' + release: needs: - lint - test + - test-api runs-on: ubuntu-latest steps: - name: Checkout code