chore: improve ci pipeline (#1764)
* fix: caching deps + add true parallelization to integration tests api * fix: github action * chore: upgrade to yarn berry (#1762) * init migration * remove: yarn.lock from all pkgs * fix: build script in pkgs * adjust yarn config * fix: yarn.lock and yarnrc.yml * fix: github actions * fix: wrong type * fix (medusa-react): use dts-cli instead of tsdx * fix: yarn.lock * fix: yarn v * fix: prepare script * add: comment on why we need to downgrade yarn before medusa-dev * chore: move to Turborepo (#1763) * increase number of parallel nodes * fix (medusa-fulfillment-webshipper): build script * fix: use new version of medusa-dev * fix: rename cache-bootstrap to cache-deps
This commit is contained in:
33
.github/actions/cache-bootstrap/action.yml
vendored
33
.github/actions/cache-bootstrap/action.yml
vendored
@@ -1,33 +0,0 @@
|
||||
name: cache-bootstrap
|
||||
description: Creates a cache with the given extension for lerna packages
|
||||
inputs:
|
||||
extension:
|
||||
description: Extension for cache name
|
||||
partial:
|
||||
description: Boolean flag to describe whether or not to run a partial bootstrap when finding cache
|
||||
default: false
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
# 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}}-v8-${{ 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.
|
||||
|
||||
# yarn install --frozen-lockfile
|
||||
- run: |
|
||||
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"
|
||||
yarn bootstrap --npm-client=npm --hoist --since "origin/${ref}...HEAD" --concurrency=2
|
||||
fi
|
||||
shell: bash
|
||||
23
.github/actions/cache-deps/action.yml
vendored
Normal file
23
.github/actions/cache-deps/action.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
name: cache-deps
|
||||
description: Creates a cache with the given extension for monorepo dependencies
|
||||
inputs:
|
||||
extension:
|
||||
description: Extension for cache name
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: actions/cache@v3
|
||||
id: cache
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
*/*/node_modules
|
||||
key: ${{ runner.os }}-yarn-${{inputs.extension}}-v8-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-${{inputs.extension}}-v8
|
||||
# We want to only bootstrap and install if no cache is found.
|
||||
- run: |
|
||||
if [[ "${{steps.cache.outputs.cache-hit}}" != "true" ]]; then
|
||||
yarn install --immutable
|
||||
fi
|
||||
shell: bash
|
||||
4
.github/actions/setup-server/action.yml
vendored
4
.github/actions/setup-server/action.yml
vendored
@@ -24,8 +24,8 @@ runs:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: "yarn"
|
||||
|
||||
- name: Bootstrap packages
|
||||
uses: ./.github/actions/cache-bootstrap
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/cache-deps
|
||||
with:
|
||||
extension: ${{ inputs.cache-extension }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user