Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: continue on node package install failure #236

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions .github/workflows/repo_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
description: (compile-commands.json)
post-init: |
# black complains about py2 code
${TRUNK_PATH} check disable black
# markdownlint fails for some reason, and what we really care about anyways is clang-tidy
${TRUNK_PATH} check disable black markdownlint
mkdir build
cd build
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
Expand All @@ -44,8 +45,6 @@ jobs:
sed -i "s|lint:|lint:\n compile_commands: json|" .trunk/trunk.yaml
cp local-action/repo_tests/yaml_cpp.yaml .trunk/user.yaml
${TRUNK_PATH} check enable clang-tidy
# markdownlint fails for some reason, and what we really care about anyways is clang-tidy
${TRUNK_PATH} check disable markdownlint

- repo: pallets/flask
ref: 4bcd4be6b7d69521115ef695a379361732bcaea6
Expand Down Expand Up @@ -75,6 +74,23 @@ jobs:
fi
description: (test for setup-node)

- repo: prawn-test-staging-rw/node-packages-failure-test
ref: main
post-init: |
if [ "${FAILED_NODE_PACKAGE_INSTALL}" != "true" ]; then
echo "::error::Node package install didn't fail"
exit 1
fi
if grep -q "✔ eslint" <(${TRUNK_PATH} check list --color=false); then
echo "::error::eslint not disabled"
exit 1
fi
if grep -q "✔ stylelint" <(${TRUNK_PATH} check list --color=false); then
echo "::error::stylelint not disabled"
exit 1
fi
description: (test for continuing on node package install failure)

- repo: replayio/devtools
ref: 730a9f0ddaafefc2a1a293d6924ce3910cd156ac
description: (has trunk.yaml)
Expand All @@ -95,10 +111,7 @@ jobs:
description: (has trunk.yaml)
post-init: |
# all of these linters have failures
${TRUNK_PATH} check disable svgo
${TRUNK_PATH} check disable golangci-lint
${TRUNK_PATH} check disable prettier
${TRUNK_PATH} check disable oxipng
${TRUNK_PATH} check disable svgo golangci-lint prettier oxipng

- repo: shopify/draggable
ref: e6cf325a98c11b8aefbfb626b7a91b95d1c340c9
Expand Down
1 change: 1 addition & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ runs:
run: |
if [ ! -e .trunk/trunk.yaml ]; then
${TRUNK_PATH:-trunk} init
echo "INITIALIZED_TRUNK=true" >>$GITHUB_ENV
fi

- name: Detect setup strategy
Expand Down
20 changes: 20 additions & 0 deletions setup-env/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,26 @@ runs:
hashFiles(env.HASH_GLOB) }}

- name: Install ${{ env.PACKAGE_MANAGER }} packages
id: install_packages
if: env.PACKAGE_MANAGER && (env.NODE_VERSION_FILE || env.RUN_INSTALL_NODE_PACKAGES)
shell: bash
run: ${{ env.INSTALL_CMD }}
continue-on-error: true

- name: Check for package install
if: env.PACKAGE_MANAGER && (env.NODE_VERSION_FILE || env.RUN_INSTALL_NODE_PACKAGES)
shell: bash
run: |
if [ ${{ steps.install_packages.outcome }} == "success" ]; then
exit 0
fi
echo "FAILED_NODE_PACKAGE_INSTALL=true" >>$GITHUB_ENV

if [[ -z "${INITIALIZED_TRUNK}" ]]; then
echo "::error::Failed to install node packages."
echo "::error::Aborting because this repo has an existing trunk.yaml file."
exit 1
fi
echo "::warning::Failed to install node packages."
echo "::warning::Disabling linters that depend on node packages."
${TRUNK_PATH} check disable eslint stylelint
Loading