Skip to content

feat: add build-time environment variable validation #64

feat: add build-time environment variable validation

feat: add build-time environment variable validation #64

Workflow file for this run

name: CI/CD Pipeline
on:
pull_request:
branches: [ main ]
jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
- name: Run TypeScript type checking
run: npm run typecheck
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run Jest tests
run: npm test
e2e:
name: E2E Tests
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_STELLAR_NETWORK: testnet
NEXT_PUBLIC_SOROBAN_RPC_URL: https://soroban-testnet.stellar.org
NEXT_PUBLIC_HORIZON_URL: https://horizon-testnet.stellar.org
NEXT_PUBLIC_AXIONVERA_VAULT_CONTRACT_ID: test-vault-contract-id
NEXT_PUBLIC_AXIONVERA_TOKEN_CONTRACT_ID: test-token-contract-id
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm run test:e2e
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
build:
name: Build Application
runs-on: ubuntu-latest
needs: [lint, test, e2e]
env:
NEXT_PUBLIC_STELLAR_NETWORK: testnet
NEXT_PUBLIC_SOROBAN_RPC_URL: https://soroban-testnet.stellar.org
NEXT_PUBLIC_HORIZON_URL: https://horizon-testnet.stellar.org
NEXT_PUBLIC_AXIONVERA_VAULT_CONTRACT_ID: ci-placeholder-vault-contract
NEXT_PUBLIC_AXIONVERA_TOKEN_CONTRACT_ID: ci-placeholder-token-contract
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-files
path: .next/
retention-days: 1