mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 04:21:09 +00:00
fix: yarn smoke tests (#1185)
This commit is contained in:
@@ -3,4 +3,5 @@
|
|||||||
!tsconfig.build.json
|
!tsconfig.build.json
|
||||||
!tsconfig.json
|
!tsconfig.json
|
||||||
!package-lock.json
|
!package-lock.json
|
||||||
!packages/*
|
!packages/*
|
||||||
|
!scripts/local-pack.sh
|
||||||
|
|||||||
3
.github/workflows/performance.yaml
vendored
3
.github/workflows/performance.yaml
vendored
@@ -28,9 +28,10 @@ jobs:
|
|||||||
- run: redocly-next --version
|
- run: redocly-next --version
|
||||||
- run: redocly --version
|
- run: redocly --version
|
||||||
- name: Run Benchmark
|
- name: Run Benchmark
|
||||||
run: hyperfine -i --warmup 3 'REDOCLY_TELEMETRY=off redocly lint packages/core/src/benchmark/benches/rebilly.yaml' 'REDOCLY_TELEMETRY=off redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml' --export-markdown benchmark_check.md --export-json benchmark_check.json
|
run: hyperfine -i --warmup 3 'redocly lint packages/core/src/benchmark/benches/rebilly.yaml' 'redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml' --export-markdown benchmark_check.md --export-json benchmark_check.json
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
REDOCLY_TELEMETRY: off
|
||||||
- name: Comment PR
|
- name: Comment PR
|
||||||
uses: thollander/actions-comment-pull-request@v2
|
uses: thollander/actions-comment-pull-request@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
18
.github/workflows/smoke.yaml
vendored
18
.github/workflows/smoke.yaml
vendored
@@ -167,7 +167,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli-clean.tgz" "yarn" # FIXME: Use actual openapi-core
|
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli.tgz" "yarn"
|
||||||
|
|
||||||
run-smoke--yarn--node-20--redoc:
|
run-smoke--yarn--node-20--redoc:
|
||||||
needs: prepare-smoke
|
needs: prepare-smoke
|
||||||
@@ -180,7 +180,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli-clean.tgz" "yarn" # FIXME: Use actual openapi-core
|
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli.tgz" "yarn"
|
||||||
|
|
||||||
run-smoke--yarn--node-18:
|
run-smoke--yarn--node-18:
|
||||||
needs: prepare-smoke
|
needs: prepare-smoke
|
||||||
@@ -193,7 +193,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli-clean.tgz" "yarn" # FIXME: Use actual openapi-core
|
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli.tgz" "yarn"
|
||||||
|
|
||||||
run-smoke--yarn--node-18--redoc:
|
run-smoke--yarn--node-18--redoc:
|
||||||
needs: prepare-smoke
|
needs: prepare-smoke
|
||||||
@@ -206,7 +206,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli-clean.tgz" "yarn" # FIXME: Use actual openapi-core
|
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli.tgz" "yarn"
|
||||||
|
|
||||||
run-smoke--webpack--node-14:
|
run-smoke--webpack--node-14:
|
||||||
needs: prepare-smoke
|
needs: prepare-smoke
|
||||||
@@ -251,18 +251,12 @@ jobs:
|
|||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli-clean.tgz" "yarn" # FIXME: Use actual openapi-core
|
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli.tgz" "yarn"
|
||||||
|
|
||||||
run-docker-image:
|
run-smoke--docker-image:
|
||||||
needs: prepare-smoke
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Test Docker Image
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: __tests__/smoke
|
|
||||||
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
|
|
||||||
- name: Build docker image
|
- name: Build docker image
|
||||||
run: docker build -t redocly/cli:latest .
|
run: docker build -t redocly/cli:latest .
|
||||||
- name: Run docker image
|
- name: Run docker image
|
||||||
|
|||||||
@@ -16,13 +16,14 @@ RUN npm run prepare
|
|||||||
|
|
||||||
# Install redocly-cli globally, similar to npm install --global @redocly/cli
|
# Install redocly-cli globally, similar to npm install --global @redocly/cli
|
||||||
# but the local package is used here
|
# but the local package is used here
|
||||||
RUN mv -- "$(npm pack packages/cli/)" redocly-cli.tgz && \
|
RUN apk update && apk add jq && \
|
||||||
npm install --global redocly-cli.tgz
|
npm run pack:prepare && \
|
||||||
|
npm install --global redocly-cli.tgz
|
||||||
|
|
||||||
# npm pack in the previous RUN command does not include these assets
|
# npm pack in the previous RUN command does not include these assets
|
||||||
RUN cp packages/cli/src/commands/preview-docs/preview-server/default.hbs /usr/local/lib/node_modules/@redocly/cli/lib/commands/preview-docs/preview-server/default.hbs && \
|
RUN cp packages/cli/src/commands/preview-docs/preview-server/default.hbs /usr/local/lib/node_modules/@redocly/cli/lib/commands/preview-docs/preview-server/default.hbs && \
|
||||||
cp packages/cli/src/commands/preview-docs/preview-server/hot.js /usr/local/lib/node_modules/@redocly/cli/lib/commands/preview-docs/preview-server/hot.js && \
|
cp packages/cli/src/commands/preview-docs/preview-server/hot.js /usr/local/lib/node_modules/@redocly/cli/lib/commands/preview-docs/preview-server/hot.js && \
|
||||||
cp packages/cli/src/commands/build-docs/template.hbs /usr/local/lib/node_modules/@redocly/cli/lib/commands/build-docs/template.hbs
|
cp packages/cli/src/commands/build-docs/template.hbs /usr/local/lib/node_modules/@redocly/cli/lib/commands/build-docs/template.hbs
|
||||||
|
|
||||||
# Clean up to reduce image size
|
# Clean up to reduce image size
|
||||||
RUN npm cache clean --force && rm -rf /build
|
RUN npm cache clean --force && rm -rf /build
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
"webpack-bundle": "webpack --config webpack.config.ts",
|
"webpack-bundle": "webpack --config webpack.config.ts",
|
||||||
"upload": "node scripts/archive-and-upload-bundle.js",
|
"upload": "node scripts/archive-and-upload-bundle.js",
|
||||||
"deploy-local": "npm run webpack-bundle && npm run compile && ENV=local npm run upload",
|
"deploy-local": "npm run webpack-bundle && npm run compile && ENV=local npm run upload",
|
||||||
"pack:prepare": "bash scripts/local-pack.sh"
|
"pack:prepare": "./scripts/local-pack.sh"
|
||||||
},
|
},
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
cd packages/core && core=$(npm pack | tail -n 1) && mv $core ../../openapi-core.tgz && cd ../../ &&
|
cd packages/core && core=$(npm pack | tail -n 1) && mv $core ../../openapi-core.tgz && cd ../../ &&
|
||||||
|
|
||||||
version=$(cat ./packages/core/package.json | jq '.version' | tr -d '"')
|
version=$(cat ./packages/core/package.json | jq '.version' | tr -d '"')
|
||||||
jq '.dependencies."@redocly/openapi-core" = $packagefile' ./packages/cli/package.json --arg packagefile file:./openapi-core.tgz > package.json.tmp && mv package.json.tmp ./packages/cli/package.json &&
|
jq '.dependencies."@redocly/openapi-core" = $packagefile' ./packages/cli/package.json --arg packagefile ./openapi-core.tgz > package.json.tmp && mv package.json.tmp ./packages/cli/package.json &&
|
||||||
|
|
||||||
cd packages/cli && cli=$(npm pack | tail -n 1) && mv $cli ../../redocly-cli.tgz
|
cd packages/cli && cli=$(npm pack | tail -n 1) && mv $cli ../../redocly-cli.tgz
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
# For Workflows (Webpack)
|
# For Workflows (Webpack)
|
||||||
npm run webpack-bundle
|
npm run webpack-bundle
|
||||||
|
|
||||||
# For yarn (Doesn't support version changing)
|
|
||||||
(cd packages/cli && cli=$(npm pack | tail -n 1) && mv $cli ../../__tests__/smoke/redocly-cli-clean.tgz)
|
|
||||||
|
|
||||||
# For npm (Mutates packages/cli/package.json)
|
# For npm (Mutates packages/cli/package.json)
|
||||||
npm run pack:prepare
|
npm run pack:prepare
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user