diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml new file mode 100644 index 0000000..f162e0c --- /dev/null +++ b/.github/workflows/integration-test.yml @@ -0,0 +1,51 @@ +name: Integration tests +on: [pull_request] +env: + CI: true +jobs: + test: + name: Run integration tests + runs-on: ubuntu-latest + + services: + ceramic: + image: public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest + options: >- + daemon + ports: + - 5001:5001 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install pnpm + id: pnpm-install + uses: pnpm/action-setup@v3 + with: + version: 9.3.0 + run_install: false + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: pnpm-store + + - name: Install dependencies and build + run: pnpm install --frozen-lockfile + + - name: Test + run: cd tests/c1-integration && pnpm run test \ No newline at end of file diff --git a/package.json b/package.json index 9b017fc..23040c4 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "packageManager": "pnpm@9.3.0", "scripts": { "build": "pnpm --filter \"@ceramic-sdk/*\" build:types && turbo run build:js", - "lint": "biome check --write packages/*", - "lint:ci": "biome ci packages/*", + "lint": "biome check --write packages/* tests/*", + "lint:ci": "biome ci packages/* tests/*", "test": "turbo run test -- --passWithNoTests", "test:ci": "turbo run test:ci -- --passWithNoTests" }, diff --git a/tests/c1-integration/package.json b/tests/c1-integration/package.json index aa4cca2..1fb0b50 100644 --- a/tests/c1-integration/package.json +++ b/tests/c1-integration/package.json @@ -13,8 +13,7 @@ "sideEffects": false, "scripts": { "lint": "eslint src --fix", - "test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js", - "test:ci": "pnpm run test --ci --coverage" + "test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js" }, "dependencies": { "@ceramic-sdk/events": "workspace:^", @@ -24,9 +23,7 @@ "@ceramic-sdk/model-protocol": "workspace:^" }, "jest": { - "extensionsToTreatAsEsm": [ - ".ts" - ], + "extensionsToTreatAsEsm": [".ts"], "moduleNameMapper": { "^(\\.{1,2}/.*)\\.js$": "$1" },