Feat:cancel previous actions on push (#707)
This commit is contained in:
1 parent
e82737a035
commit
649d8d34aa
1 file changed
+30
-20
@@ -3,22 +3,27 @@ on: [push, pull_request]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unit-tests:
|
unit-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Cancel Previous Runs
|
||||||
|
uses: styfle/cancel-workflow-action@0.9.1
|
||||||
|
with:
|
||||||
|
access_token: ${{ github.token }}
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2.3.5
|
uses: actions/checkout@v2.3.5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
- name: Setup Node.js environment
|
||||||
uses: actions/setup-node@v2.4.1
|
uses: actions/setup-node@v2.4.1
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: "14"
|
||||||
cache: 'yarn'
|
cache: "yarn"
|
||||||
|
|
||||||
- name: Assert changed
|
- name: Assert changed
|
||||||
run: ./scripts/assert-changed-files-actions.sh "packages"
|
run: ./scripts/assert-changed-files-actions.sh "packages"
|
||||||
|
|
||||||
- name: Bootstrap packages
|
- name: Bootstrap packages
|
||||||
uses: ./.github/actions/cache-bootstrap
|
uses: ./.github/actions/cache-bootstrap
|
||||||
with:
|
with:
|
||||||
@@ -26,11 +31,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1
|
run: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1
|
||||||
|
|
||||||
integration-tests:
|
integration-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres
|
image: postgres
|
||||||
env:
|
env:
|
||||||
@@ -43,30 +48,35 @@ jobs:
|
|||||||
--health-retries 5
|
--health-retries 5
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Cancel Previous Runs
|
||||||
|
uses: styfle/cancel-workflow-action@0.9.1
|
||||||
|
with:
|
||||||
|
access_token: ${{ github.token }}
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2.3.5
|
uses: actions/checkout@v2.3.5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
- name: Setup Node.js environment
|
||||||
uses: actions/setup-node@v2.4.1
|
uses: actions/setup-node@v2.4.1
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: "14"
|
||||||
cache: 'yarn'
|
cache: "yarn"
|
||||||
|
|
||||||
- name: Bootstrap packages
|
- name: Bootstrap packages
|
||||||
uses: ./.github/actions/cache-bootstrap
|
uses: ./.github/actions/cache-bootstrap
|
||||||
with:
|
with:
|
||||||
extension: integration-tests
|
extension: integration-tests
|
||||||
|
|
||||||
- name: Install dev cli
|
- name: Install dev cli
|
||||||
run: sudo npm i -g medusa-dev-cli
|
run: sudo npm i -g medusa-dev-cli
|
||||||
|
|
||||||
- name: Set path to medusa repo
|
- name: Set path to medusa repo
|
||||||
run: medusa-dev --set-path-to-repo `pwd`
|
run: medusa-dev --set-path-to-repo `pwd`
|
||||||
|
|
||||||
- name: Force install
|
- name: Force install
|
||||||
run: medusa-dev --force-install
|
run: medusa-dev --force-install
|
||||||
working-directory: integration-tests/api
|
working-directory: integration-tests/api
|
||||||
@@ -74,9 +84,9 @@ jobs:
|
|||||||
- name: Build integration tests
|
- name: Build integration tests
|
||||||
run: yarn build
|
run: yarn build
|
||||||
working-directory: integration-tests/api
|
working-directory: integration-tests/api
|
||||||
|
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
run: yarn test
|
run: yarn test
|
||||||
working-directory: integration-tests/api
|
working-directory: integration-tests/api
|
||||||
env:
|
env:
|
||||||
DB_PASSWORD: postgres
|
DB_PASSWORD: postgres
|
||||||
Reference in new issue
Block a user