From 3401dc596c9c90924ae5cf1d9bbf7ff948b3bdb2 Mon Sep 17 00:00:00 2001 From: Ihor Karpiuk <106662428+IgorKarpiuk@users.noreply.github.com> Date: Thu, 20 Jul 2023 12:57:44 +0300 Subject: [PATCH] chore: job for testing new version (#1184) --- .github/workflows/deploy.yaml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index daa4abd1..f3fc837b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -109,3 +109,44 @@ jobs: push: true tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} + test-released-version: + needs: + - test + - deploy + - publish + - dockerhub + name: Test released version + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + - name: Install CLI from npm + run: npm i -g @redocly/cli@latest + - name: Test version from NPM + run: | + expected_version="$(cat package.json | jq -r '.version')" + actual_version="$(redocly --version)" + if [[ $expected_version == $actual_version ]]; then + echo "The version is correct. Actual version: $actual_version" + else + echo "The version is incorrect. Expected: $expected_version, actual: $actual_version" + exit 1 + fi + redocly lint https://raw.githubusercontent.com/Rebilly/api-definitions/main/openapi/openapi.yaml + redocly bundle https://raw.githubusercontent.com/Rebilly/api-definitions/main/openapi/openapi.yaml + redocly build-docs https://raw.githubusercontent.com/Rebilly/api-definitions/main/openapi/openapi.yaml + - name: Pull docker image + run: docker pull redocly/cli:latest + - name: Test docker image + run: | + expected_version="$(cat package.json | jq -r '.version')" + actual_version="$(docker run --rm redocly/cli --version)" + if [[ $expected_version == $actual_version ]]; then + echo "The version is correct. Actual version: $actual_version" + else + echo "The version is incorrect. Expected: $expected_version, actual: $actual_version" + exit 1 + fi + docker run --rm redocly/cli lint https://raw.githubusercontent.com/Rebilly/api-definitions/main/openapi/openapi.yaml + docker run --rm redocly/cli bundle https://raw.githubusercontent.com/Rebilly/api-definitions/main/openapi/openapi.yaml + docker run --rm redocly/cli build-docs https://raw.githubusercontent.com/Rebilly/api-definitions/main/openapi/openapi.yaml