From 12fc400f9e57625988039449f586cca7c21fa418 Mon Sep 17 00:00:00 2001 From: vladyslav Date: Fri, 16 May 2025 10:47:48 +0700 Subject: [PATCH 1/3] docs: fix formatting of comparison tables in README --- README.md | 40 ++++++++++++++++++++-------------------- packages/httio/README.md | 38 +++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 9bf39c2..d0eeb30 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # **Httio** -[![codecov](https://codecov.io/gh/vladstsk/httio/graph/badge.svg?token=15VVLNIEN3)](https://codecov.io/gh/vladstsk/httio) +[![codecov](https://codecov.io/gh/vladstsk/httio/graph/badge.svg?token=15VVLNIEN3&flag=httio)](https://codecov.io/gh/vladstsk/httio?flag=httio) [![size](https://img.shields.io/bundlephobia/minzip/httio)](https://bundlephobia.com/package/httio) [![tree-shaking](https://badgen.net/bundlephobia/tree-shaking/httio)](https://bundlephobia.com/package/httio) [![types](https://badgen.net/npm/types/httio)](https://github.com/vladstsk/httio) @@ -43,30 +43,30 @@ ## Why Httio? -| Feature | Description | -|------------------------------|-------------------------------------------------------------------------------------------------------| -| **TypeScript-first** | All public types are exported; strict compile-time checks. | -| **Tiny footprint** | Ships as ESM + CJS, zero runtime dependencies. | -| **Lazy parsing** | Body is not parsed automatically—_you_ decide when and how. | -| **One interface everywhere** | Works in browsers, Node 18+, edge functions—no polyfills required. | -| **Extensible** | Middleware chain for logging, auth, caching, etc. | -| **Convenient cloning** | `extends()` lets you reuse and override base options elegantly. | -| **Full control** | Everything from `fetch` is exposed plus syntactic sugar (`params`, `json`, `timeout`). | +| Feature | Description | +|------------------------------|----------------------------------------------------------------------------------------| +| **TypeScript-first** | All public types are exported; strict compile-time checks. | +| **Tiny footprint** | Ships as ESM + CJS, zero runtime dependencies. | +| **Lazy parsing** | Body is not parsed automatically—_you_ decide when and how. | +| **One interface everywhere** | Works in browsers, Node 18+, edge functions—no polyfills required. | +| **Extensible** | Middleware chain for logging, auth, caching, etc. | +| **Convenient cloning** | `extends()` lets you reuse and override base options elegantly. | +| **Full control** | Everything from `fetch` is exposed plus syntactic sugar (`params`, `json`, `timeout`). | --- ## Httio vs. The Rest -| Library | Size
(min + gzip) | TS‑first | Browser | Node | Native `fetch` | Middleware | Retries | Deps | Notes | -|------------------|:--------------------------------------------------------------------------:|:--------------:|:-------:|:----:|:-------------------:|:----------:|:-------:|:--------------------------------------------------------------------------------------------------------------------------------------:|-------------------------------| -| **Httio** | ![size](https://img.shields.io/bundlephobia/minzip/httio?label) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/httio?label)](https://bundlephobia.com/package/httio) | Modern, tiny | -| Axios | ![size](https://img.shields.io/bundlephobia/minzip/axios?label) | ⚠️ | ✅ | ✅ | ❌ | ⚠️ | ⚠️ | [![deps](https://badgen.net/bundlephobia/dependency-count/axios?label)](https://bundlephobia.com/package/axios) | Heavy | -| isomorphic-fetch | ![size](https://img.shields.io/bundlephobia/minzip/isomorphic-fetch?label) | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/isomorphic-fetch?label)](https://bundlephobia.com/package/isomorphic-fetch) | Simple shim | -| ky | ![size](https://img.shields.io/bundlephobia/minzip/ky?label) | ✅ | ✅ | ✅ | ✅ | ⚠️ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/ky?label)](https://bundlephobia.com/package/ky) | Small, fetch‑first | -| superagent | ![size](https://img.shields.io/bundlephobia/minzip/superagent?label) | ⚠️ | ✅ | ✅ | ❌ | ✅ | ⚠️ | [![deps](https://badgen.net/bundlephobia/dependency-count/superagent?label)](https://bundlephobia.com/package/superagent) | Classic | -| request | ![size](https://img.shields.io/bundlephobia/minzip/request?label) | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/request?label)](https://bundlephobia.com/package/request) | Deprecated | -| r2 | ![size](https://img.shields.io/bundlephobia/minzip/r2?label) | ⚠️ | ❌ | ✅ | ✅ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/r2?label)](https://bundlephobia.com/package/r2) | Minimal | -| phin | ![size](https://img.shields.io/bundlephobia/minzip/phin?label) | ⚠️ | ❌ | ✅ | ❌ | ❌ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/phin?label)](https://bundlephobia.com/package/phin) | Promise client | +| Library | Size
(min + gzip) | TS‑first | Browser | Node | Native `fetch` | Middleware | Retries | Deps | Notes | +|------------------------|:-------------------------------------------------------------------------------------------------------------------------------:|:--------------:|:-------:|:----:|:-------------------:|:----------:|:-------:|:-------------------------------------------------------------------------------------------------------------------------------------:|-------------------------------| +| **Httio** | [![size](https://img.shields.io/bundlephobia/minzip/httio?label)](https://bundlephobia.com/package/httio) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/httio?label)](https://bundlephobia.com/package/httio) | Modern, tiny | +| Axios | [![size](https://img.shields.io/bundlephobia/minzip/axios?label)](https://bundlephobia.com/package/axios) | ⚠️ | ✅ | ✅ | ❌ | ⚠️ | ⚠️ | [![deps](https://badgen.net/bundlephobia/dependency-count/axios?label)](https://bundlephobia.com/package/axios) | Heavy | +| isomorphic‑fetch | [![size](https://img.shields.io/bundlephobia/minzip/isomorphic-fetch?label)](https://bundlephobia.com/package/isomorphic-fetch) | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/isomorphic-fetch?label)](https://bundlephobia.com/package/isomorphic-fetch) | Simple shim | +| ky | [![size](https://img.shields.io/bundlephobia/minzip/ky?label)](https://bundlephobia.com/package/ky) | ✅ | ✅ | ✅ | ✅ | ⚠️ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/ky?label)](https://bundlephobia.com/package/ky) | Small, fetch‑first | +| superagent | [![size](https://img.shields.io/bundlephobia/minzip/superagent?label)](https://bundlephobia.com/package/superagent) | ⚠️ | ✅ | ✅ | ❌ | ✅ | ⚠️ | [![deps](https://badgen.net/bundlephobia/dependency-count/superagent?label)](https://bundlephobia.com/package/superagent) | Classic | +| request | [![size](https://img.shields.io/bundlephobia/minzip/request?label)](https://bundlephobia.com/package/request) | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/request?label)](https://bundlephobia.com/package/request) | Deprecated | +| r2 | [![size](https://img.shields.io/bundlephobia/minzip/r2?label)](https://bundlephobia.com/package/r2) | ⚠️ | ❌ | ✅ | ✅ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/r2?label)](https://bundlephobia.com/package/r2) | Minimal | +| phin | [![size](https://img.shields.io/bundlephobia/minzip/phin?label)](https://bundlephobia.com/package/phin) | ⚠️ | ❌ | ✅ | ❌ | ❌ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/phin?label)](https://bundlephobia.com/package/phin) | Promise client | ### Key takeaways diff --git a/packages/httio/README.md b/packages/httio/README.md index 748cdb1..7446e38 100644 --- a/packages/httio/README.md +++ b/packages/httio/README.md @@ -43,30 +43,30 @@ ## Why Httio? -| Feature | Description | -|------------------------------|-------------------------------------------------------------------------------------------------------| -| **TypeScript-first** | All public types are exported; strict compile-time checks. | -| **Tiny footprint** | Ships as ESM + CJS, zero runtime dependencies. | -| **Lazy parsing** | Body is not parsed automatically—_you_ decide when and how. | -| **One interface everywhere** | Works in browsers, Node 18+, edge functions—no polyfills required. | -| **Extensible** | Middleware chain for logging, auth, caching, etc. | -| **Convenient cloning** | `extends()` lets you reuse and override base options elegantly. | -| **Full control** | Everything from `fetch` is exposed plus syntactic sugar (`params`, `json`, `timeout`). | +| Feature | Description | +|------------------------------|----------------------------------------------------------------------------------------| +| **TypeScript-first** | All public types are exported; strict compile-time checks. | +| **Tiny footprint** | Ships as ESM + CJS, zero runtime dependencies. | +| **Lazy parsing** | Body is not parsed automatically—_you_ decide when and how. | +| **One interface everywhere** | Works in browsers, Node 18+, edge functions—no polyfills required. | +| **Extensible** | Middleware chain for logging, auth, caching, etc. | +| **Convenient cloning** | `extends()` lets you reuse and override base options elegantly. | +| **Full control** | Everything from `fetch` is exposed plus syntactic sugar (`params`, `json`, `timeout`). | --- ## Httio vs. The Rest -| Library | Size
(min + gzip) | TS‑first | Browser | Node | Native `fetch` | Middleware | Retries | Deps | Notes | -|------------------|:--------------------------------------------------------------------------:|:--------------:|:-------:|:----:|:-------------------:|:----------:|:-------:|:--------------------------------------------------------------------------------------------------------------------------------------:|-------------------------------| -| **Httio** | ![size](https://img.shields.io/bundlephobia/minzip/httio?label) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/httio?label)](https://bundlephobia.com/package/httio) | Modern, tiny | -| Axios | ![size](https://img.shields.io/bundlephobia/minzip/axios?label) | ⚠️ | ✅ | ✅ | ❌ | ⚠️ | ⚠️ | [![deps](https://badgen.net/bundlephobia/dependency-count/axios?label)](https://bundlephobia.com/package/axios) | Heavy | -| isomorphic-fetch | ![size](https://img.shields.io/bundlephobia/minzip/isomorphic-fetch?label) | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/isomorphic-fetch?label)](https://bundlephobia.com/package/isomorphic-fetch) | Simple shim | -| ky | ![size](https://img.shields.io/bundlephobia/minzip/ky?label) | ✅ | ✅ | ✅ | ✅ | ⚠️ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/ky?label)](https://bundlephobia.com/package/ky) | Small, fetch‑first | -| superagent | ![size](https://img.shields.io/bundlephobia/minzip/superagent?label) | ⚠️ | ✅ | ✅ | ❌ | ✅ | ⚠️ | [![deps](https://badgen.net/bundlephobia/dependency-count/superagent?label)](https://bundlephobia.com/package/superagent) | Classic | -| request | ![size](https://img.shields.io/bundlephobia/minzip/request?label) | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/request?label)](https://bundlephobia.com/package/request) | Deprecated | -| r2 | ![size](https://img.shields.io/bundlephobia/minzip/r2?label) | ⚠️ | ❌ | ✅ | ✅ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/r2?label)](https://bundlephobia.com/package/r2) | Minimal | -| phin | ![size](https://img.shields.io/bundlephobia/minzip/phin?label) | ⚠️ | ❌ | ✅ | ❌ | ❌ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/phin?label)](https://bundlephobia.com/package/phin) | Promise client | +| Library | Size
(min + gzip) | TS‑first | Browser | Node | Native `fetch` | Middleware | Retries | Deps | Notes | +|------------------------|:-------------------------------------------------------------------------------------------------------------------------------:|:--------------:|:-------:|:----:|:-------------------:|:----------:|:-------:|:-------------------------------------------------------------------------------------------------------------------------------------:|-------------------------------| +| **Httio** | [![size](https://img.shields.io/bundlephobia/minzip/httio?label)](https://bundlephobia.com/package/httio) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/httio?label)](https://bundlephobia.com/package/httio) | Modern, tiny | +| Axios | [![size](https://img.shields.io/bundlephobia/minzip/axios?label)](https://bundlephobia.com/package/axios) | ⚠️ | ✅ | ✅ | ❌ | ⚠️ | ⚠️ | [![deps](https://badgen.net/bundlephobia/dependency-count/axios?label)](https://bundlephobia.com/package/axios) | Heavy | +| isomorphic‑fetch | [![size](https://img.shields.io/bundlephobia/minzip/isomorphic-fetch?label)](https://bundlephobia.com/package/isomorphic-fetch) | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/isomorphic-fetch?label)](https://bundlephobia.com/package/isomorphic-fetch) | Simple shim | +| ky | [![size](https://img.shields.io/bundlephobia/minzip/ky?label)](https://bundlephobia.com/package/ky) | ✅ | ✅ | ✅ | ✅ | ⚠️ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/ky?label)](https://bundlephobia.com/package/ky) | Small, fetch‑first | +| superagent | [![size](https://img.shields.io/bundlephobia/minzip/superagent?label)](https://bundlephobia.com/package/superagent) | ⚠️ | ✅ | ✅ | ❌ | ✅ | ⚠️ | [![deps](https://badgen.net/bundlephobia/dependency-count/superagent?label)](https://bundlephobia.com/package/superagent) | Classic | +| request | [![size](https://img.shields.io/bundlephobia/minzip/request?label)](https://bundlephobia.com/package/request) | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/request?label)](https://bundlephobia.com/package/request) | Deprecated | +| r2 | [![size](https://img.shields.io/bundlephobia/minzip/r2?label)](https://bundlephobia.com/package/r2) | ⚠️ | ❌ | ✅ | ✅ | ❌ | ❌ | [![deps](https://badgen.net/bundlephobia/dependency-count/r2?label)](https://bundlephobia.com/package/r2) | Minimal | +| phin | [![size](https://img.shields.io/bundlephobia/minzip/phin?label)](https://bundlephobia.com/package/phin) | ⚠️ | ❌ | ✅ | ❌ | ❌ | ✅ | [![deps](https://badgen.net/bundlephobia/dependency-count/phin?label)](https://bundlephobia.com/package/phin) | Promise client | ### Key takeaways From 3dac31c1262d61663d7ca9dc07cdae4398089a6e Mon Sep 17 00:00:00 2001 From: vladyslav Date: Fri, 16 May 2025 14:59:29 +0700 Subject: [PATCH 2/3] ci: add CI and release workflows --- .github/workflows/ci.yml | 63 +++++++++++++ .github/workflows/release.yml | 160 ++++++++++++++++++++++++++++++++ .github/workflows/releasing.yml | 3 +- .github/workflows/report.yml | 48 ++++++---- .github/workflows/testing.yml | 47 ---------- 5 files changed, 253 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/testing.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e279b72 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: CI + +on: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + +jobs: + tests: + strategy: + fail-fast: false + + matrix: + node: [ 20, 22 ] + + platform: + - { name: MacOS, os: macOS-latest } + - { name: Linux, os: ubuntu-latest } + - { name: Windows, os: windows-latest } + + include: + - os: ubuntu-latest + node: 20 + lint: true + coverage: true + + name: Node ${{ matrix.node }} on ${{ matrix.platform.name }} + runs-on: ${{ matrix.platform.os }} + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js v${{ matrix.node }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: npm + cache-dependency-path: package-lock.json + + - run: npm ci + + - if: ${{ matrix.lint }} + run: npm run lint + + - run: npm run build + + - run: npm test + + - name: Upload artifacts + if: ${{ success() && matrix.coverage }} + uses: actions/upload-artifact@v4 + with: + name: artifacts + path: | + ./packages/**/dist + ./packages/**/README.md + ./packages/**/package.json + ./packages/**/coverage/lcov.info + overwrite: 'true' + retention-days: 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4bcc71b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,160 @@ +name: Release + +on: + workflow_run: + workflows: [ "CI" ] + types: + - completed + +jobs: + debug: + steps: + - name: Debug + - run: | + echo "run_id = ${{ github.event.workflow_run.id }}" + echo "artifact path = ${{ steps.download.outputs.dir }}" + + +# publish: +# if: > +# github.event.workflow_run.conclusion == 'success' && +# ( +# github.event.workflow_run.head_branch == 'main' || +# github.event.workflow_run.head_branch == 'staging' +# ) +# +# runs-on: ubuntu-latest +# +# permissions: +# contents: write +# id-token: write +# +# steps: +# - uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# +# - uses: actions/setup-node@v4 +# with: +# cache: npm +# node-version: 22 +# registry-url: "https://registry.npmjs.org" +# +# - name: Download dist artifacts +# uses: dawidd6/action-download-artifact@v2 +# with: +# run_id: ${{ github.event.workflow_run.id }} +# name: artifacts +# path: ./artifacts +# +# ############################################################### +# # 2. находим пакеты, у которых изменилась версия +# ############################################################### +# - name: Detect changed packages +# id: detect +# run: | +# node ./scripts/changed-packages.js >> "$GITHUB_OUTPUT" +# +# ############################################################### +# # 3. публикуем каждый изменившийся пакет +# ############################################################### +# - name: Publish to npm +# if: steps.detect.outputs.changed != '' +# env: +# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} +# run: | +# IFS=',' read -ra PKGS <<< "${{ steps.detect.outputs.changed }}" +# for P in "${PKGS[@]}"; do +# echo "Publishing $P" +# npm publish "./artifacts/dist-$P" --tag latest --access public +# done +# +# ############################################################### +# # 4. создаём теги и Release-страницу +# ############################################################### +# - name: Push git tags +# if: steps.detect.outputs.changed != '' +# run: | +# IFS=',' read -ra PKGS <<< "${{ steps.detect.outputs.changed }}" +# for P in "${PKGS[@]}"; do +# VER=$(jq -r .version < packages/$P/package.json) +# git tag "$P@$VER" +# done +# git push --tags +# +# - name: GitHub Release +# if: steps.detect.outputs.changed != '' +# uses: softprops/action-gh-release@v1 +# with: +# tag_name: ${{ github.ref_name }} # последний созданный тег +# generate_release_notes: true +# +# bump: +# runs-on: ubuntu-latest +# +# steps: +# - name: Checkout code +# uses: actions/checkout@v4 +# with: +# fetch-tags: true +# fetch-depth: 0 +# +# - name: Setup Node.js +# uses: actions/setup-node@v4 +# with: +# cache: 'npm' +# node-version: 22 +# registry-url: 'https://registry.npmjs.org/' +# +# - name: Install dependencies +# run: npm ci +# +# - name: Create builds +# run: npm run build +# +# - name: Configure Git for Lerna +# run: | +# git config user.name "github-actions[bot]" +# git config user.email "github-actions[bot]@users.noreply.github.com" +# +# - name: Bump versions +# env: +# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} +# run: | +# npx lerna version --yes --no-push +# git push origin HEAD:releases/pr-${{ github.event.pull_request.number }} +# +# for TAG in $(git tag); do +# if git ls-remote --tags origin refs/tags/$TAG | grep -q $TAG; then +# echo "Tag $TAG already exists on the remote server, skipping" +# else +# git push origin $TAG +# gh release create "$TAG" --generate-notes +# +# echo "Tag $TAG successfully created" +# fi +# done +# +# npx lerna publish from-git --yes +# +# - name: Create Release Pull Request +# id: cpr +# uses: peter-evans/create-pull-request@v7 +# with: +# token: ${{ secrets.GITHUB_TOKEN }} +# commit-message: 'chore(release): bump versions' +# title: 'chore(release): bump versions' +# body: Automated version bump & changelog +# base: main +# branch: releases/pr-${{ github.event.pull_request.number }} +# labels: automerge +# delete-branch: true +# +# - name: Enable auto-merge on Release PR +# if: steps.cpr.outputs.pull-request-number != '' +# uses: peter-evans/enable-pull-request-automerge@v3 +# with: +# token: ${{ secrets.GITHUB_TOKEN }} +# pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} +# merge-method: squash diff --git a/.github/workflows/releasing.yml b/.github/workflows/releasing.yml index 7dbf307..3fe4b74 100644 --- a/.github/workflows/releasing.yml +++ b/.github/workflows/releasing.yml @@ -1,7 +1,8 @@ name: Releasing on: - pull_request: + push: +# pull_request: types: - closed branches: diff --git a/.github/workflows/report.yml b/.github/workflows/report.yml index a7438cd..a9f10b5 100644 --- a/.github/workflows/report.yml +++ b/.github/workflows/report.yml @@ -1,34 +1,42 @@ -name: Testing +name: Reporting on: - push: - branches: - - main + workflow_run: + workflows: [ "__CI__" ] + types: + - completed jobs: codecov: - runs-on: ubuntu-latest + if: > + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.pull_requests[0].merged == true && + ( + github.event.workflow_run.pull_requests[0].base.ref == 'main' || + github.event.workflow_run.pull_requests[0].base.ref == 'tests' + ) - steps: - - uses: actions/checkout@v4 + strategy: + fail-fast: false - - name: Setup Node.js ${{ matrix.node_version }} - uses: actions/setup-node@v4 - with: - cache: 'npm' - node-version: 22 + matrix: + package: [ httio, rest ] - - name: Install dependencies - run: npm ci + runs-on: ubuntu-latest - - name: Run tests - run: npm test + steps: + - name: Download coverage artifact + uses: dawidd6/action-download-artifact@v2 + with: + run_id: ${{ github.event.workflow_run.id }} + name: coverage + path: ./coverage - - name: Upload coverage reports to Codecov + - name: Upload ${{ matrix.package }} coverage to Codecov uses: codecov/codecov-action@v5 with: - slug: vladstsk/httio - flags: httio,rest - files: ./packages/httio/coverage/lcov.info,./packages/rest/coverage/lcov.info + name: ${{ matrix.package }} token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/packages/${{ matrix.package }}/coverage/lcov.info + flags: ${{ matrix.package }} fail_ci_if_error: true diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml deleted file mode 100644 index 413d263..0000000 --- a/.github/workflows/testing.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Testing - -on: - pull_request: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test: - name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }} - runs-on: ${{ matrix.os }} - if: ${{ github.head_ref != 'release' }} - - strategy: - matrix: - os: - - macOS-latest - - ubuntu-latest - - windows-latest - node-version: - - 20.x - - 22.x - - steps: - - uses: actions/checkout@v4 - - - name: Setup Node.js ${{ matrix.node_version }} - uses: actions/setup-node@v4 - with: - cache: 'npm' - node-version: ${{ matrix.node-version }} - - - name: Install dependencies - run: npm ci - - - name: Run linter - run: npm run lint - - - name: Create builds - run: npm run build - - - name: Run tests - run: npm test From fa006756182a2accc6f6b7ddb86cac944fd90ebf Mon Sep 17 00:00:00 2001 From: vladyslav Date: Fri, 16 May 2025 15:08:09 +0700 Subject: [PATCH 3/3] ci: update debug job to output full workflow run details --- .github/workflows/release.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4bcc71b..5c90d70 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,12 +8,11 @@ on: jobs: debug: + runs-on: ubuntu-latest + steps: - name: Debug - - run: | - echo "run_id = ${{ github.event.workflow_run.id }}" - echo "artifact path = ${{ steps.download.outputs.dir }}" - + run: echo ${{ toJSON(github.event.workflow_run) }} # publish: # if: >