Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(init): swc, script and integration tests #79

Merged
merged 5 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CHAIN_ID=

## RPC config
ALCHEMY_API_KEY=
INFURA_API_KEY=

### DATABASE ###

Expand Down
13 changes: 0 additions & 13 deletions .env.test

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/ci-test-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 'Integration tests'
on:
pull_request:

jobs:
integration-test:
runs-on: ubuntu-latest
environment: test

env:
PORT: ${{ vars.PORT }}
CHAIN_ID: ${{ vars.CHAIN_ID }}
BATCH_SIZE: ${{ vars.BATCH_SIZE }}
DELAY: ${{ vars.DELAY }}
SENTRY_ENVIRONMENT: ${{ vars.SENTRY_ENVIRONMENT }}
SUPABASE_DB_URL: ${{ vars.SUPABASE_DB_URL }}
SUPABASE_SERVICE_API_KEY: ${{ secrets.SUPABASE_SERVICE_API_KEY }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}

permissions:
# Required to checkout the code
contents: read
# Required to put a comment into the pull-request
pull-requests: write

steps:
- uses: actions/checkout@v4
- name: 'Install Node'
uses: actions/setup-node@v4
with:
node-version: '20.x'

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false

- name: Install dependencies
run: pnpm install

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- uses: supabase/setup-cli@v1
name: Install Supabase CLI
with:
version: latest

- name: Start Supabase local development setup
run: supabase start

- name: 'Run integration test'
run: npx pnpm supabase:seed && npx vitest run --config ./vitest.integration.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: 'Test'
name: 'Unit tests'
on:
pull_request:

jobs:
test:
unit-test:
runs-on: ubuntu-latest
environment: test

Expand All @@ -14,8 +14,9 @@ jobs:
DELAY: ${{ vars.DELAY }}
SENTRY_ENVIRONMENT: ${{ vars.SENTRY_ENVIRONMENT }}
SUPABASE_DB_URL: ${{ vars.SUPABASE_DB_URL }}
SUPABASE_SERVICE_API_KEY: ${{ vars.SUPABASE_SERVICE_API_KEY }}
SUPABASE_SERVICE_API_KEY: ${{ secrets.SUPABASE_SERVICE_API_KEY }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}

permissions:
# Required to checkout the code
Expand All @@ -37,7 +38,7 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: 'Test'
- name: 'Run unit tests'
run: npx vitest --coverage.enabled true
- name: 'Report Coverage'
# Set if: always() to also generate the report if tests are failing
Expand Down
4 changes: 4 additions & 0 deletions .snaplet/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"projectId": "clulce7i401jelyi3bai5qc0r",
"adapter": "postgres"
}
Loading