diff --git a/.github/workflows/performance.yaml b/.github/workflows/performance.yaml index dd952e873a..b1ec1e4bf0 100644 --- a/.github/workflows/performance.yaml +++ b/.github/workflows/performance.yaml @@ -5,6 +5,10 @@ on: branches: - main +env: + CI: true + REDOCLY_TELEMETRY: off + jobs: latest-vs-next: runs-on: ubuntu-latest @@ -29,9 +33,6 @@ jobs: - run: redocly --version - name: Run Benchmark 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: - CI: true - REDOCLY_TELEMETRY: off - name: Comment PR if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} @@ -67,9 +68,6 @@ jobs: npm test # This command is generated and injected into package.json in the previous step. cat benchmark_check.md npm run chart # Creates benchmark_chart.md with the performance bar chart. - env: - CI: true - REDOCLY_TELEMETRY: off - name: Comment PR if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} diff --git a/.github/workflows/smoke-plugins.yaml b/.github/workflows/smoke-plugins.yaml index 832f94ee62..985be0c7a8 100644 --- a/.github/workflows/smoke-plugins.yaml +++ b/.github/workflows/smoke-plugins.yaml @@ -1,4 +1,4 @@ -name: Plugins smoke tests +name: Smoke tests on: pull_request: diff --git a/.github/workflows/smoke-rebilly.yaml b/.github/workflows/smoke-rebilly.yaml new file mode 100644 index 0000000000..a762826fae --- /dev/null +++ b/.github/workflows/smoke-rebilly.yaml @@ -0,0 +1,25 @@ +name: Smoke tests + +on: + pull_request: + types: [opened, synchronize, reopened] + +env: + CI: true + REDOCLY_TELEMETRY: off + +jobs: + run-smoke-rebilly: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 22 + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run Rebilly smoke test + run: npm run smoke:rebilly + env: + SANDBOX_REBILLY_TOKEN: ${{ secrets.SANDBOX_REBILLY_TOKEN }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3f67c7d6c3..51be07b48f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -7,6 +7,10 @@ on: branches: - main +env: + CI: true + REDOCLY_TELEMETRY: off + jobs: build-and-unit: runs-on: ubuntu-latest @@ -18,17 +22,13 @@ jobs: cache: 'npm' - name: Install dependencies run: npm ci - env: - CI: true - name: Typecheck run: npm run typecheck - name: Unit Tests run: npm run unit - name: E2E Tests run: npm run e2e - env: - CI: true - SANDBOX_REBILLY_TOKEN: ${{ secrets.SANDBOX_REBILLY_TOKEN }} + cli-package-test: runs-on: ubuntu-latest steps: @@ -39,8 +39,6 @@ jobs: cache: 'npm' - name: Install dependencies run: npm ci - env: - CI: true - name: Prepare CLI and Core packages run: npm run pack:prepare - name: Install CLI Package @@ -76,7 +74,5 @@ jobs: cache: 'npm' - name: Install dependencies run: npm ci - env: - CI: true - run: npm run eslint - run: npm run prettier:check diff --git a/__tests__/respect/rebilly/__snapshots__/rebilly.test.ts.snap b/__tests__/smoke-rebilly/__snapshots__/rebilly.smoke.ts.snap similarity index 100% rename from __tests__/respect/rebilly/__snapshots__/rebilly.test.ts.snap rename to __tests__/smoke-rebilly/__snapshots__/rebilly.smoke.ts.snap diff --git a/__tests__/respect/rebilly/rebilly-description.yaml b/__tests__/smoke-rebilly/rebilly-description.yaml similarity index 100% rename from __tests__/respect/rebilly/rebilly-description.yaml rename to __tests__/smoke-rebilly/rebilly-description.yaml diff --git a/__tests__/respect/rebilly/rebilly.test.ts b/__tests__/smoke-rebilly/rebilly.smoke.ts similarity index 96% rename from __tests__/respect/rebilly/rebilly.test.ts rename to __tests__/smoke-rebilly/rebilly.smoke.ts index dfdd0bead8..a767ff71af 100644 --- a/__tests__/respect/rebilly/rebilly.test.ts +++ b/__tests__/smoke-rebilly/rebilly.smoke.ts @@ -1,4 +1,4 @@ -import { getParams, getCommandOutput, getFixturePath } from '../utils'; +import { getParams, getCommandOutput, getFixturePath } from '../respect/utils'; import { join } from 'path'; test('rebilly test case', () => { diff --git a/__tests__/respect/rebilly/rebilly.yaml b/__tests__/smoke-rebilly/rebilly.yaml similarity index 100% rename from __tests__/respect/rebilly/rebilly.yaml rename to __tests__/smoke-rebilly/rebilly.yaml diff --git a/package.json b/package.json index e4e8fe3154..475942e1ee 100644 --- a/package.json +++ b/package.json @@ -16,13 +16,14 @@ "coverage:cli": "npm run jest -- --roots packages/cli/src --coverage", "coverage:core": "npm run jest -- --roots packages/core/src --coverage", "coverage:respect-core": "npm run jest -- --roots packages/respect-core/src --coverage", - "typecheck": "tsc --noEmit --skipLibCheck", "e2e": "npm run webpack-bundle -- --mode=none && REDOCLY_TELEMETRY=off NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --roots=./__tests__/", + "smoke:rebilly": "npm run webpack-bundle -- --mode=none && REDOCLY_TELEMETRY=off NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --roots=__tests__/smoke-rebilly/ --testMatch='**/rebilly.smoke.ts'", "prettier": " npx prettier --write \"**/*.{ts,js,yaml,yml,json,md}\"", "prettier:check": "npx prettier --check \"**/*.{ts,js,yaml,yml,json,md}\"", "eslint": "eslint packages/**", "clean": "rm -rf packages/**/lib packages/**/node_modules packages/**/*.tsbuildinfo package-lock.json node_modules dist && git checkout package-lock.json", - "watch": "tsc -b tsconfig.build.json --watch ", + "typecheck": "tsc --noEmit --skipLibCheck", + "watch": "npm run respect:parser:generate && tsc -b tsconfig.build.json --watch", "compile": "npm run respect:parser:generate && tsc -b tsconfig.build.json", "prepare": "npm run compile", "cli": "ts-node packages/cli/src/index.ts", diff --git a/packages/respect-core/jest.config.unit.js b/packages/respect-core/jest.config.unit.js deleted file mode 100644 index 18527627f1..0000000000 --- a/packages/respect-core/jest.config.unit.js +++ /dev/null @@ -1,6 +0,0 @@ -const defaultConfig = require('./jest.config.js'); - -module.exports = { - ...defaultConfig, - testPathIgnorePatterns: ['/node_modules/', '/e2e/__tests__/'], -};