Skip to content

Commit

Permalink
Merge branch 'dependabot/npm_and_yarn/tests/playwright/dev/eslint-a2c…
Browse files Browse the repository at this point in the history
…1e8145f' of https://github.com/hwinther/test into dependabot/npm_and_yarn/tests/playwright/dev/eslint-a2c1e8145f
  • Loading branch information
hwinther committed Nov 6, 2024
2 parents 80887e7 + 92085b2 commit 520545c
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions .github/actions/frontend-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,40 @@ runs:
cache-dependency-path: "${{ inputs.working_directory }}/yarn.lock"

- name: Install dependencies
id: dependency-install
shell: bash
working-directory: ${{ inputs.working_directory }}
run: |
echo "::group::Install dependencies"
[[ "${{ inputs.package_manager }}" == "npm" ]] && npm ci || true
[[ "${{ inputs.package_manager }}" == "yarn" ]] && yarn install --immutable --immutable-cache --check-cache || true
set +e
if [[ "${{ inputs.package_manager }}" == "npm" ]]; then
npm ci 1>dependency.out 2>&1
exit_code=$?
elif [[ "${{ inputs.package_manager }}" == "yarn" ]]; then
yarn install --immutable --immutable-cache --check-cache 1>dependency.out 2>&1
exit_code=$?
else
echo "::error::Invalid package manager: ${{ inputs.package_manager }}"
exit_code=1
fi
echo "Dependency installation exit code: $exit_code"
set -e
echo -e "\nDependency installation:\n"
cat dependency.out
if [[ $exit_code -ne 0 ]]
then
echo "::error::Dependency installation failed with errors."
echo "## ❌ Dependency installation failed with errors:" > dependency.md
cat dependency.out >> dependency.md
exit 1
fi
echo "::endgroup::"
- name: Build
id: node-build
if: steps.dependency-install.outcome == 'success'
shell: bash
working-directory: ${{ inputs.working_directory }}
run: |
Expand Down Expand Up @@ -86,7 +110,7 @@ runs:
echo "::endgroup::"
- name: Lint
if: always()
if: steps.dependency-install.outcome == 'success'
id: node-lint
shell: bash
working-directory: ${{ inputs.working_directory }}
Expand Down Expand Up @@ -151,8 +175,9 @@ runs:
working-directory: ${{ inputs.working_directory }}
run: |
echo "# ${{ env.WORKFLOW_SHORT_NAME }}" > combined.md
cat build.md >> combined.md
cat lint.md >> combined.md
cat dependency.md >> combined.md
[ -f build.md ] && cat build.md >> combined.md
[ -f lint.md ] && cat lint.md >> combined.md
echo "result<<EOF"$'\n'"$(cat combined.md)"$'\n'EOF >> $GITHUB_OUTPUT
- name: "Create or Update PR Comment"
Expand Down

0 comments on commit 520545c

Please sign in to comment.