chore: job for testing new version (#1184)

This commit is contained in:
Ihor Karpiuk
2023-07-20 12:57:44 +03:00
committed by GitHub
parent 857d894c54
commit 3401dc596c

View File

@@ -109,3 +109,44 @@ jobs:
push: true push: true
tags: ${{ steps.docker_meta.outputs.tags }} tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }} 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