Feat/new actions (#586)
* test * test * create integration testing workflow * Create unit-testing.yml * Rename integration-testing to integration-testing.yml * initial testing * Update assert-changed-files.sh * Update integration-testing.yml * Update unit-testing.yml * Update assert-changed-files.sh * Delete integration-testing.yml * Update assert-changed-files.sh * Update assert-changed-files.sh * Update assert-changed-files.sh * Update order.js * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Update unit-testing.yml * Create cache-bootstrap.yml * Update cache-bootstrap.yml * Update cache-bootstrap.yml * Update cache-bootstrap.yml * Update unit-testing.yml * extracted action * corrected ext. name for int. tests * checked out actions * added fetching of actions * updated * updated * moved package * updated * Update action.yml * Update action.yml * ended if statement * updated * updated * removed error * updated cache version * update * updated to more strict cache policy * update * updated * updated * update * update * update * update * update * update * update * update * updated to also include on PR * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * removed current branch from diff * updated comment * Update action.yml * Update action.yml * Update action.yml * save before merge * Update action.yml * Update product.js * Update product.js * Update action.yml * Update action.yml * Update action.yml * Update action.yml * Update assert-changed-files-actions.sh * Update assert-changed-files-actions.sh * Update product-variant.js * Update product.js * Update product.js * cleanup Co-authored-by: Sebastian Mateos Nicolajsen <80953876+sebastiannicolajsen@users.noreply.github.com> Co-authored-by: Sebastian M. Nicolajsen <sebastian.m.nicolajsen@gmail.com>
This commit is contained in:
14
.github/actions/cache-bootstrap/action.yml
vendored
14
.github/actions/cache-bootstrap/action.yml
vendored
@@ -9,27 +9,25 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
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
|
- uses: actions/cache@v2
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
node_modules
|
node_modules
|
||||||
*/*/node_modules
|
*/*/node_modules
|
||||||
key: ${{ runner.os }}-yarn-${{inputs.extension}}-v6-${{ 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.
|
# We want to only bootstrap and install if no cache is found.
|
||||||
# Futhermore, we might want to do a partial, hoisted, bootstrap towards
|
# Futhermore, we might want to do a partial, hoisted, bootstrap towards
|
||||||
# the base branch if it exists, otherwise we choose develop for this.
|
# the base branch if it exists, otherwise we choose develop for this.
|
||||||
|
|
||||||
# yarn install --frozen-lockfile
|
# yarn install --frozen-lockfile
|
||||||
- run: |
|
- run: |
|
||||||
yarn install --frozen-lockfile
|
|
||||||
if [[ "${{steps.cache.outputs.cache-hit}}" != "true" || "${{inputs.partial}}" != "true" ]]; then
|
if [[ "${{steps.cache.outputs.cache-hit}}" != "true" || "${{inputs.partial}}" != "true" ]]; then
|
||||||
|
yarn install --frozen-lockfile
|
||||||
yarn bootstrap --concurrency=2
|
yarn bootstrap --concurrency=2
|
||||||
elif [[ "${{inputs.partial}}" = "true" ]]; then
|
elif [[ "${{inputs.partial}}" = "true" ]]; then
|
||||||
[[ ! -z "${GITHUB_BASE_REF}" ]] && ref="${GITHUB_BASE_REF#refs/heads/}" || ref="develop"
|
[[ ! -z "${GITHUB_BASE_REF}" ]] && ref="${GITHUB_BASE_REF#refs/heads/}" || ref="develop"
|
||||||
yarn bootstrap --npm-client=npm --hoist --since "origin/${ref}" --concurrency=2
|
yarn bootstrap --npm-client=npm --hoist --since "origin/${ref}...HEAD" --concurrency=2
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,16 +21,20 @@ if [ "$IS_CI" = true ]; then
|
|||||||
git config --local --unset url."https://github.com/".insteadOf
|
git config --local --unset url."https://github.com/".insteadOf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILES_COUNT="$(git diff-tree --no-commit-id --name-only -r "$CIRCLE_BRANCH" origin/master | grep -E "$GREP_PATTERN" -c)"
|
# Make sure that we are diffing towards the right branch, in github actions this is different
|
||||||
|
# depending on whether or not we are creating a pull request or not.
|
||||||
|
[ ! -z ${GITHUB_BASE_REF} ] && HAS_BASE=true || HAS_BASE=false
|
||||||
|
[ HAS_BASE = true ] && COMPARE="${GITHUB_BASE_REF#refs/heads/}" || COMPARE="develop"
|
||||||
|
FILES_COUNT="$(git diff-tree --no-commit-id --name-only -r origin/"$COMPARE" | grep -E "$GREP_PATTERN" -c)"
|
||||||
|
|
||||||
if [ "$IS_CI" = true ]; then
|
if [ "$IS_CI" = true ]; then
|
||||||
# reset to previous state
|
# reset to previous state
|
||||||
git reset --hard $CIRCLE_SHA1
|
git reset --hard $GITHUB_SHA
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$FILES_COUNT" -eq 0 ]; then
|
if [ "$FILES_COUNT" -eq 0 ]; then
|
||||||
echo "0 files matching '$GREP_PATTERN'; exiting and marking successful."
|
echo "0 files matching '$GREP_PATTERN'; exiting and marking successful."
|
||||||
circleci step halt || exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "$FILES_COUNT file(s) matching '$GREP_PATTERN'; continuing."
|
echo "$FILES_COUNT file(s) matching '$GREP_PATTERN'; continuing."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user