Files
medusa-store/.github/workflows/action.yml
Zakaria El Asri 33426ddb4c fix: make plugin tests run with integration test suites (#1101)
* fix: make plugin tests run with integration test suites"

* add: plugins to test pipeline

* add: run integration tests on different jobs + fix failing test command

* fix: typo

* fix: pipeline
2022-02-25 16:39:28 +01:00

159 lines
3.8 KiB
YAML

name: Medusa Pipeline
on: [pull_request]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2.3.5
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@v2.4.1
with:
node-version: "14"
cache: "yarn"
- name: Assert changed
run: ./scripts/assert-changed-files-actions.sh "packages"
- name: Bootstrap packages
uses: ./.github/actions/cache-bootstrap
with:
extension: unit-tests
- name: Build Packages
run: yarn build
- name: Run unit tests
run: yarn test
integration-tests-api:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2.3.5
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@v2.4.1
with:
node-version: "14"
cache: "yarn"
- name: Bootstrap packages
uses: ./.github/actions/cache-bootstrap
with:
extension: integration-tests
- name: Build Packages
run: lerna run build
- name: Install dev cli
run: sudo npm i -g medusa-dev-cli
- name: Set path to medusa repo
run: medusa-dev --set-path-to-repo `pwd`
- name: Force install API
run: medusa-dev --force-install
working-directory: integration-tests/api
- name: Build integration tests
run: yarn build
working-directory: integration-tests/api
- name: Run API integration tests
run: yarn test:integration:api --maxWorkers=50% --silent=false
env:
DB_PASSWORD: postgres
integration-tests-plugins:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2.3.5
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@v2.4.1
with:
node-version: "14"
cache: "yarn"
- name: Bootstrap packages
uses: ./.github/actions/cache-bootstrap
with:
extension: integration-tests
- name: Build Packages
run: lerna run build
- name: Install dev cli
run: sudo npm i -g medusa-dev-cli
- name: Set path to medusa repo
run: medusa-dev --set-path-to-repo `pwd`
- name: Force install
run: medusa-dev --force-install
working-directory: integration-tests/plugins
- name: Build plugin integration tests
run: yarn build
working-directory: integration-tests/plugins
- name: Run plugin integration tests
run: yarn test:integration:plugins --maxWorkers=50% --silent=false
env:
DB_PASSWORD: postgres