From 3950a90bcd9a8d768bfda5bc81db91997aeb6649 Mon Sep 17 00:00:00 2001 From: Michele Riva Date: Tue, 21 Mar 2023 15:00:33 +0100 Subject: [PATCH] ci: fixes deno ci --- .github/workflows/benchmark-comparison.yml | 131 --------------------- .github/workflows/ci.yml | 35 ------ .github/workflows/deno.yml | 6 +- .github/workflows/release.yml | 74 ------------ 4 files changed, 3 insertions(+), 243 deletions(-) delete mode 100644 .github/workflows/benchmark-comparison.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/benchmark-comparison.yml b/.github/workflows/benchmark-comparison.yml deleted file mode 100644 index 6fa627122..000000000 --- a/.github/workflows/benchmark-comparison.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: Benchmark Compare - -on: - pull_request_target: - types: [labeled] - -jobs: - benchmark: - name: Run benchmarks - if: ${{ github.event.label.name == 'benchmark' }} - runs-on: ubuntu-latest - permissions: - contents: read - outputs: - PR-BENCH-14: ${{ steps.benchmark-pr.outputs.BENCH_RESULT14 }} - PR-BENCH-16: ${{ steps.benchmark-pr.outputs.BENCH_RESULT16 }} - PR-BENCH-18: ${{ steps.benchmark-pr.outputs.BENCH_RESULT18 }} - MAIN-BENCH-14: ${{ steps.benchmark-main.outputs.BENCH_RESULT14 }} - MAIN-BENCH-16: ${{ steps.benchmark-main.outputs.BENCH_RESULT16 }} - MAIN-BENCH-18: ${{ steps.benchmark-main.outputs.BENCH_RESULT18 }} - strategy: - matrix: - node-version: [14, 16, 18] - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - persist-credentials: false - ref: ${{github.event.pull_request.head.sha}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Install pnpm - uses: pnpm/action-setup@v2.0.1 - id: pnpm-install - with: - version: 7 - run_install: false - - - name: Get pnpm store directory - id: pnpm-cache - run: | - echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install - - - name: Build Orama - run: pnpm run build - - - name: Run benchmarks - id: benchmark-pr - run: | - pnpm benchmark > ./bench-result.md - result=$(cat ./bench-result.md) - # output multiline string - result="${result//'%'/'%25'}" - result="${result//$'\n'/'%0A'}" - result="${result//$'\r'/'%0D'}" - echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result" - - # main benchmark - - name: Checkout - uses: actions/checkout@v3 - with: - persist-credentials: false - ref: "main" - - - name: Install dependencies - run: pnpm install - - - name: Build Orama - run: pnpm run build - - - name: Run benchmarks - id: benchmark-main - run: | - pnpm benchmark > ./bench-result.md - result=$(cat ./bench-result.md) - # output multiline string - result="${result//'%'/'%25'}" - result="${result//$'\n'/'%0A'}" - result="${result//$'\r'/'%0D'}" - echo "::set-output name=BENCH_RESULT${{matrix.node-version}}::$result" - - output-benchmark: - name: Add results to PR - needs: [benchmark] - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: Create comment - uses: thollander/actions-comment-pull-request@v1 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - message: | - **Node**: 14 - **PR**: ${{ needs.benchmark.outputs.PR-BENCH-14 }} - **MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-14 }} - - --- - - **Node**: 16 - **PR**: ${{ needs.benchmark.outputs.PR-BENCH-16 }} - **MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-16 }} - - --- - - **Node**: 18 - **PR**: ${{ needs.benchmark.outputs.PR-BENCH-18 }} - **MAIN**: ${{ needs.benchmark.outputs.MAIN-BENCH-18 }} - - - name: Remove label from PR - uses: actions-ecosystem/action-remove-labels@v1 - with: - labels: | - benchmark - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 7373dc908..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: CI -on: - push: - branches: - - main - pull_request: -jobs: - run-tests: - name: Run CI - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Use Node.js LTS - uses: actions/setup-node@v3 - with: - node-version: lts/* - - name: Restore cached dependencies - uses: actions/cache@v3 - with: - path: ~/.pnpm-store - key: node-modules-${{ hashFiles('package.json') }} - - name: Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: latest - - name: Install dependencies - run: pnpm install - - name: Install Playwright Browsers - run: pnpm dlx playwright install --with-deps - - name: Run Tests - run: | - pnpm run test - pnpm run test:smoke - pnpm dlx playwright test diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml index eac00ff42..33074cd2f 100644 --- a/.github/workflows/deno.yml +++ b/.github/workflows/deno.yml @@ -34,7 +34,7 @@ jobs: run: pnpm install - name: Prepare for Deno run: | - sh tests/ci/build.sh - sed -i'' -E -e 's#from "([^.])#from "npm:\1#' tests/ci/non-node-ci-runner.js + sh ./packages/orama/tests/ci/build.sh + sed -i'' -E -e 's#from "([^.])#from "npm:\1#' ./packages/orama/tests/ci/non-node-ci-runner.js - name: Run Tests - run: deno run --allow-read --allow-env tests/ci/non-node-ci-runner.js | node_modules/.bin/tap-mocha-reporter spec + run: deno run --allow-read --allow-env ./packages/orama/tests/ci/non-node-ci-runner.js | ./packages/orama/node_modules/.bin/tap-mocha-reporter spec diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index cc6814246..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: Release - -on: - workflow_dispatch: - inputs: - semver: - description: "The semver to use" - required: true - default: "patch" - type: choice - options: - - patch - - minor - - major - - prerelease - - prepatch - - preminor - - premajor - tag: - description: "The npm tag" - required: false - default: "latest" - commit-message: - description: "The commit message template" - required: false - default: "chore: Release {version}" - prerelease: - description: "The prelease prefix" - required: false - default: "beta" - type: choice - options: - - alpha - - beta - - rc - pull_request: - types: [closed] - branches: - - main - - "release/**" - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Use Node.js LTS - uses: actions/setup-node@v3 - with: - node-version: lts/* - - name: Restore cached dependencies - uses: actions/cache@v3 - with: - path: ~/.pnpm-store - key: node-modules-${{ hashFiles('package.json') }} - - name: Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: latest - - name: Release - uses: nearform/optic-release-automation-action@v4 - with: - npm-token: ${{ secrets[format('NPM_TOKEN_{0}', github.actor)] || secrets.NPM_TOKEN }} - optic-token: ${{ secrets[format('OPTIC_TOKEN_{0}', github.actor)] || secrets.OPTIC_TOKEN }} - commit-message: ${{ github.event.inputs.commit-message }} - semver: ${{ github.event.inputs.semver }} - npm-tag: ${{ github.event.inputs.tag }} - prerelease-prefix: ${{ github.event.inputs.prerelease }} - version-prefix: "v" - build-command: | - pnpm install - pnpm run build