Skip to content

Commit

Permalink
Add CI workflow for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulLeCam committed Jun 26, 2024
1 parent dbf20ef commit 4d51a8f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 7 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"packageManager": "[email protected]",
"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"
},
Expand Down
7 changes: 2 additions & 5 deletions tests/c1-integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:^",
Expand All @@ -24,9 +23,7 @@
"@ceramic-sdk/model-protocol": "workspace:^"
},
"jest": {
"extensionsToTreatAsEsm": [
".ts"
],
"extensionsToTreatAsEsm": [".ts"],
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
},
Expand Down

0 comments on commit 4d51a8f

Please sign in to comment.