-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(integration-tests): Improve tests pipeline
- Loading branch information
Showing
5 changed files
with
33 additions
and
21,488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ on: | |
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.x, 15., 16.x] | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
@@ -22,40 +25,48 @@ jobs: | |
fetch-depth: 0 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v2.4.1 | ||
uses: actions/setup-node@v3.1.1 | ||
with: | ||
node-version: "14" | ||
cache: "npm" | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: 'npm install' | ||
run: npm install | ||
|
||
- name: 'run unit tests' | ||
run: npm run test | ||
|
||
integration-tests: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: integration-tests | ||
strategy: | ||
matrix: | ||
node-version: [14.x, 15., 16.x] | ||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: medusa-extender | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v2.4.1 | ||
uses: actions/setup-node@v3.1.1 | ||
with: | ||
node-version: "14" | ||
cache: "npm" | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: 'npm install' | ||
run: npm install | ||
- name: 'prepare packages and install' | ||
run: | | ||
npm run build && npm pack --pack-destination integration-tests && PACKAGE_NAME=$(cat package.json | grep version | head -1 | awk -F: '{ print "medusa-extender-", $2, ".tgz" }' | sed 's/[ ",]//g') && cd integration-tests && npm i ${PACKAGE_NAME} && rm -f ${PACKAGE_NAME} && npm i | ||
- name: 'run integration tests' | ||
run: npm run test:integration | ||
run: | | ||
cd integration-tests | ||
npm run test:integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ tsconfig.tsbuildinfo | |
|
||
.env | ||
.env.local | ||
.env.test | ||
.env.test | ||
|
||
package-lock.json |
Oops, something went wrong.