Why: Suppressing errors and not failing the execution will lead to misleading errors of the following tests. Fixes CORE-461
221 lines
5.4 KiB
YAML
221 lines
5.4 KiB
YAML
name: Medusa Pipeline
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "www/**"
|
|
|
|
jobs:
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
steps:
|
|
- 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: Install dependencies
|
|
uses: ./.github/actions/cache-deps
|
|
with:
|
|
extension: pipeline
|
|
|
|
unit-tests:
|
|
needs: setup
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
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: Install dependencies
|
|
uses: ./.github/actions/cache-deps
|
|
with:
|
|
extension: pipeline
|
|
|
|
- name: Build Packages
|
|
run: yarn build
|
|
|
|
- name: Run unit tests
|
|
run: yarn test
|
|
|
|
integration-tests-api:
|
|
needs: setup
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
|
|
services:
|
|
redis:
|
|
image: redis
|
|
options: >-
|
|
--health-cmd "redis-cli ping"
|
|
--health-interval 1s
|
|
--health-timeout 10s
|
|
--health-retries 10
|
|
ports:
|
|
- 6379:6379
|
|
postgres:
|
|
image: postgres
|
|
env:
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_USER: postgres
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 1s
|
|
--health-timeout 10s
|
|
--health-retries 10
|
|
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: Install dependencies
|
|
uses: ./.github/actions/cache-deps
|
|
with:
|
|
extension: pipeline
|
|
|
|
- name: Build Packages
|
|
run: yarn build
|
|
|
|
- name: Install dev cli
|
|
run: sudo npm i -g medusa-dev-cli@latest
|
|
|
|
- name: Set path to medusa repo
|
|
run: medusa-dev --set-path-to-repo `pwd`
|
|
|
|
- name: Set npm registry
|
|
run: |
|
|
yarn config set npmRegistryServer http://localhost:4873
|
|
echo -e 'unsafeHttpWhitelist:\n - "localhost"' >> .yarnrc.yml
|
|
|
|
- name: Force install
|
|
run: medusa-dev --force-install --external-registry
|
|
working-directory: integration-tests/api
|
|
|
|
- name: Build integration tests
|
|
run: yarn build
|
|
working-directory: integration-tests/api
|
|
|
|
- name: Run integration tests
|
|
run: yarn test
|
|
working-directory: integration-tests/api
|
|
env:
|
|
DB_PASSWORD: postgres
|
|
SPLIT: ${{ steps['split-tests'].outputs['split'] }}
|
|
|
|
integration-tests-plugins:
|
|
needs: setup
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres
|
|
env:
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_USER: postgres
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 1s
|
|
--health-timeout 10s
|
|
--health-retries 10
|
|
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: Install dependencies
|
|
uses: ./.github/actions/cache-deps
|
|
with:
|
|
extension: pipeline
|
|
|
|
- name: Build Packages
|
|
run: yarn 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: Set npm registry
|
|
run: |
|
|
yarn config set npmRegistryServer http://localhost:4873
|
|
echo -e 'unsafeHttpWhitelist:\n - "localhost"' >> .yarnrc.yml
|
|
|
|
- name: Force install
|
|
run: medusa-dev --force-install --external-registry
|
|
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 --silent=false
|
|
env:
|
|
DB_PASSWORD: postgres
|