feat: add support to flexible billing mode #671
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-24.04 | |
| services: | |
| postgres: | |
| image: postgres:18 | |
| ports: | |
| - 55432:5432 | |
| env: | |
| POSTGRES_DB: postgres | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ./.nvmrc | |
| cache: pnpm | |
| - name: Set up .env file | |
| run: | | |
| touch packages/fastify-app/.env | |
| echo DATABASE_URL='postgres://postgres:postgres@localhost:55432/postgres?sslmode=disable&search_path=stripe' >> packages/fastify-app/.env | |
| echo NODE_ENV=dev >> packages/fastify-app/.env | |
| echo STRIPE_SECRET_KEY=sk_test_ >> packages/fastify-app/.env | |
| echo STRIPE_WEBHOOK_SECRET=whsec_ >> packages/fastify-app/.env | |
| echo SCHEMA=stripe >> packages/fastify-app/.env | |
| echo PORT=8080 >> packages/fastify-app/.env | |
| echo API_KEY=api_key_test >> packages/fastify-app/.env | |
| - name: Install dependencies | |
| run: | | |
| pnpm install --frozen-lockfile | |
| - name: Formatting checks | |
| run: | | |
| pnpm format:check | |
| - name: Lint | |
| run: | | |
| pnpm lint | |
| - name: Builds successfully | |
| run: | | |
| pnpm build | |
| - name: Initialize DB schema | |
| run: | | |
| docker run --rm \ | |
| --network="host" \ | |
| -e PGPASSWORD=postgres \ | |
| postgres:15 \ | |
| psql -h localhost -p 55432 -U postgres -d postgres -c 'create schema if not exists "stripe";' | |
| - name: Tests | |
| run: | | |
| npm run test |