From a8970d237794c622c291486dd30feecd49ec14fe Mon Sep 17 00:00:00 2001 From: Arnaud Date: Wed, 28 May 2025 18:32:45 +0200 Subject: [PATCH] feat: add CI (#20) * Add CI * Rename CI * Remove only modifier * Define specific node version --- .github/workflows/ci.yaml | 29 +++++++++++++++++++++++++++++ README.md | 5 +++++ src/fetch-safe/fetch-safe.test.ts | 4 ++-- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..21aa846 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +env: + node_version: 22.12.0 + +permissions: + id-token: write + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.node_version }} + registry-url: "https://registry.npmjs.org" + + - run: npm ci + + - run: npm test diff --git a/README.md b/README.md index 4bb134f..23a0a0b 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,11 @@ The SDK has a small bundle size and support tree shaking. The SDK is currently under early development and the API can change at any time. +[![License: Apache](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) +[![Stability: experimental](https://img.shields.io/badge/stability-experimental-orange.svg)](#stability) +[![CI](https://github.com/codex-storage/codex-js/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/codex-storage/codex-js/actions/workflows/ci.yml?query=branch%3Amaster) + ## Breaking changes - Version 0.1.0 introduces [upload strategy](#upload) to support browser and Node JS. diff --git a/src/fetch-safe/fetch-safe.test.ts b/src/fetch-safe/fetch-safe.test.ts index 5a6484a..2f948b6 100644 --- a/src/fetch-safe/fetch-safe.test.ts +++ b/src/fetch-safe/fetch-safe.test.ts @@ -2,7 +2,7 @@ import { afterEach, assert, describe, it, vi } from "vitest"; import { Fetch } from "../fetch-safe/fetch-safe"; import { CodexError } from "../errors/errors"; -describe.only("fetch", () => { +describe("fetch", () => { afterEach(() => { vi.restoreAllMocks(); }); @@ -26,7 +26,7 @@ describe.only("fetch", () => { assert.deepStrictEqual(result, { error: true, data: error }); }); - it.only("returns an error when the json parsing failed", async () => { + it("returns an error when the json parsing failed", async () => { const mockResponse = { ok: true, status: 200,