From 40d7cb210989bd89829b46bceda3ea3ca1e0a79b Mon Sep 17 00:00:00 2001 From: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com> Date: Thu, 21 Oct 2021 14:11:54 +0200 Subject: [PATCH 1/5] Update action.yml --- .github/workflows/action.yml | 44 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index fd0a999b79..6268f01f59 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -3,22 +3,22 @@ on: [push, pull_request] jobs: unit-tests: - runs-on: ubuntu-latest - steps: + 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" + node-version: '14' + cache: 'yarn' - name: Assert changed - run: ./scripts/assert-changed-files-actions.sh "packages/*|(e2e|integration)-tests/*|yarn.lock" - + run: ./scripts/assert-changed-files.sh "packages" + - name: Bootstrap packages uses: ./.github/actions/cache-bootstrap with: @@ -27,11 +27,11 @@ jobs: - name: Run unit tests run: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 - + integration-tests: - runs-on: ubuntu-latest - - services: + runs-on: ubuntu-latest + + services: postgres: image: postgres env: @@ -44,30 +44,30 @@ jobs: --health-retries 5 ports: - 5432:5432 - - steps: + + 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" + 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 - + - 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/api @@ -75,9 +75,11 @@ jobs: - 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: + env: DB_PASSWORD: postgres + + From ac21142ba7c74298dc3d9c7b093d50e5182d650b Mon Sep 17 00:00:00 2001 From: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com> Date: Thu, 21 Oct 2021 14:12:24 +0200 Subject: [PATCH 2/5] Update action.yml --- .github/actions/cache-bootstrap/action.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/actions/cache-bootstrap/action.yml b/.github/actions/cache-bootstrap/action.yml index 5f1d565fa0..e42846deb5 100644 --- a/.github/actions/cache-bootstrap/action.yml +++ b/.github/actions/cache-bootstrap/action.yml @@ -9,19 +9,19 @@ inputs: runs: using: composite steps: - # for always overriding cache, use: pat-s/always-upload-cache@v2.1.5 + # for always overriding cache, use: pat-s/always-upload-cache@v2.1.5 - uses: actions/cache@v2 id: cache with: path: | node_modules */*/node_modules - key: ${{ runner.os }}-yarn-${{inputs.extension}}-${{ hashFiles('**/yarn.lock') }} - # We want to only bootstrap and install if no cache is found. + key: ${{ runner.os }}-yarn-${{inputs.extension}}-v5-${{ hashFiles('**/yarn.lock') }} + # We want to only bootstrap and install if no cache is found. # Futhermore, we might want to do a partial, hoisted, bootstrap towards # the base branch if it exists, otherwise we choose develop for this. - run: | - if [[ "${{steps.cache.outputs.cache-hit}}" != "true" ]]; then + if [[ "${{steps.cache.outputs.cache-hit}}" != "true" ]] || [[ "${{inputs.partial}}" != "true" ]]; then yarn install --frozen-lockfile yarn bootstrap --concurrency=2 elif [[ "${{inputs.partial}}" = "true" ]]; then @@ -29,3 +29,5 @@ runs: yarn bootstrap --npm-client=npm --hoist --since "origin/${ref}...HEAD" --concurrency=2 fi shell: bash + + From 2126a5e5d2e044fdc56e74e82b5cdc0119b49ff2 Mon Sep 17 00:00:00 2001 From: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com> Date: Thu, 21 Oct 2021 14:16:25 +0200 Subject: [PATCH 3/5] Update action.yml --- .github/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 6268f01f59..2cde0d1809 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -17,7 +17,7 @@ jobs: cache: 'yarn' - name: Assert changed - run: ./scripts/assert-changed-files.sh "packages" + run: ./scripts/assert-changed-files-actions.sh "packages" - name: Bootstrap packages uses: ./.github/actions/cache-bootstrap From 5fa3892e4ffc89f02d895c899a39349fe50d8447 Mon Sep 17 00:00:00 2001 From: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com> Date: Thu, 21 Oct 2021 14:19:31 +0200 Subject: [PATCH 4/5] Update action.yml --- .github/actions/cache-bootstrap/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/cache-bootstrap/action.yml b/.github/actions/cache-bootstrap/action.yml index e42846deb5..5d697a15a0 100644 --- a/.github/actions/cache-bootstrap/action.yml +++ b/.github/actions/cache-bootstrap/action.yml @@ -20,9 +20,11 @@ runs: # We want to only bootstrap and install if no cache is found. # Futhermore, we might want to do a partial, hoisted, bootstrap towards # the base branch if it exists, otherwise we choose develop for this. + + # yarn install --frozen-lockfile - run: | + yarn install --frozen-lockfile if [[ "${{steps.cache.outputs.cache-hit}}" != "true" ]] || [[ "${{inputs.partial}}" != "true" ]]; then - yarn install --frozen-lockfile yarn bootstrap --concurrency=2 elif [[ "${{inputs.partial}}" = "true" ]]; then [[ ! -z "${GITHUB_BASE_REF}" ]] && ref="${GITHUB_BASE_REF#refs/heads/}" || ref="develop" From 816b45baf71ae5b727e3ea97e914f5130c59fc68 Mon Sep 17 00:00:00 2001 From: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com> Date: Thu, 21 Oct 2021 14:24:04 +0200 Subject: [PATCH 5/5] Update action.yml --- .github/actions/cache-bootstrap/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/cache-bootstrap/action.yml b/.github/actions/cache-bootstrap/action.yml index 5d697a15a0..ba4fc14c74 100644 --- a/.github/actions/cache-bootstrap/action.yml +++ b/.github/actions/cache-bootstrap/action.yml @@ -16,7 +16,7 @@ runs: path: | node_modules */*/node_modules - key: ${{ runner.os }}-yarn-${{inputs.extension}}-v5-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-yarn-${{inputs.extension}}-v6-${{ hashFiles('**/yarn.lock') }} # We want to only bootstrap and install if no cache is found. # Futhermore, we might want to do a partial, hoisted, bootstrap towards # the base branch if it exists, otherwise we choose develop for this.