* fix: caching deps + add true parallelization to integration tests api * fix: github action * chore: upgrade to yarn berry (#1762) * init migration * remove: yarn.lock from all pkgs * fix: build script in pkgs * adjust yarn config * fix: yarn.lock and yarnrc.yml * fix: github actions * fix: wrong type * fix (medusa-react): use dts-cli instead of tsdx * fix: yarn.lock * fix: yarn v * fix: prepare script * add: comment on why we need to downgrade yarn before medusa-dev * chore: move to Turborepo (#1763) * increase number of parallel nodes * fix (medusa-fulfillment-webshipper): build script * fix: use new version of medusa-dev * fix: rename cache-bootstrap to cache-deps
101 lines
2.6 KiB
YAML
101 lines
2.6 KiB
YAML
name: CLI Pipeline
|
|
on: [pull_request]
|
|
|
|
jobs:
|
|
test-cli-with-database:
|
|
env:
|
|
REDIS_URL: redis://localhost:6379
|
|
DATABASE_URL: "postgres://postgres:postgres@localhost/cli-test"
|
|
|
|
strategy:
|
|
matrix:
|
|
db: [sqlite, postgres]
|
|
|
|
services:
|
|
redis:
|
|
image: redis
|
|
# Set health checks to wait until redis has started
|
|
options: >-
|
|
--health-cmd "redis-cli ping"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
- 6379:6379
|
|
|
|
postgres:
|
|
image: postgres
|
|
env:
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_DB: cli-test
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
- 5432:5432
|
|
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2.3.5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup development server
|
|
uses: ./.github/actions/setup-server
|
|
with:
|
|
cache-extension: "cli-test"
|
|
|
|
- name: Install Medusa cli
|
|
run: npm i -g @medusajs/medusa-cli
|
|
|
|
- name: Create Medusa project
|
|
run: |
|
|
medusa new cli-test
|
|
working-directory: ..
|
|
|
|
- name: Install postgres config
|
|
if: matrix.db == 'postgres'
|
|
run: |
|
|
curl \
|
|
https://raw.githubusercontent.com/medusajs/medusa-starter-default/feat/postgres-config/medusa-config.js \
|
|
--output medusa-config.js
|
|
working-directory: ../cli-test
|
|
|
|
- name: run medusa dev
|
|
run: medusa-dev --force-install
|
|
working-directory: ../cli-test
|
|
|
|
- name: Run migrations
|
|
run: medusa migrations run
|
|
working-directory: ../cli-test
|
|
|
|
- name: Seed db
|
|
run: yarn seed
|
|
working-directory: ../cli-test
|
|
|
|
- name: Create admin user
|
|
run: medusa user -e test@test.com -p password -i admin_123
|
|
working-directory: ../cli-test
|
|
|
|
########################## Test medusa develop ###############################
|
|
|
|
- name: Run development server
|
|
run: medusa develop > /dev/null 2>&1 &
|
|
working-directory: ../cli-test
|
|
|
|
- name: Testing development server
|
|
uses: ./.github/actions/test-server
|
|
|
|
########################### Test medusa start ################################
|
|
|
|
- name: Starting medusa
|
|
run: medusa start > /dev/null 2>&1 &
|
|
working-directory: ../cli-test
|
|
|
|
- name: Testing server
|
|
uses: ./.github/actions/test-server
|