diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 9b4c5b37a5..ddd525cf99 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -2,33 +2,38 @@ name: Medusa Pipeline on: [push, pull_request] jobs: - unit-tests: + setup: runs-on: ubuntu-latest 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: Checkout + uses: actions/checkout@v2.3.5 + with: + fetch-depth: 0 - - name: Assert changed - run: ./scripts/assert-changed-files-actions.sh "packages" + - 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: unit-tests - + - name: Assert changed + run: ./scripts/assert-changed-files-actions.sh "packages" + + - name: Bootstrap packages + uses: ./.github/actions/cache-bootstrap + with: + extension: unit-tests + + unit-tests: + runs-on: ubuntu-latest + needs: setup + steps: - name: Run unit tests run: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 integration-tests: runs-on: ubuntu-latest + needs: setup services: postgres: @@ -45,22 +50,6 @@ jobs: - 5432:5432 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: Bootstrap packages - uses: ./.github/actions/cache-bootstrap - with: - extension: integration-tests - - name: Install dev cli run: sudo npm i -g medusa-dev-cli