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

Build if present before test #6

Merged
merged 7 commits into from
Jul 12, 2024
Merged
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
46 changes: 39 additions & 7 deletions .github/workflows/test-ecosystem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ jobs:

# TODO: Add repo info to https://github.com/3846masa/stylelint-browser-compat
if [[ "${url}" == 'null' ]]; then
echo "::warning ::The repository info is missing. Visit https://github.com/3846masa/stylelint-browser-compat"
echo "url=https://github.com/3846masa/stylelint-browser-compat" >> "${GITHUB_OUTPUT}"
echo "fullname=3846masa/stylelint-browser-compat" >> "${GITHUB_OUTPUT}"
fi
Expand Down Expand Up @@ -140,20 +141,51 @@ jobs:
echo "yarn: $(yarn --version)"

- name: Install dependencies
continue-on-error: true
id: install-dependencies
working-directory: ${{ steps.repo-info.outputs.directory }}
run: npm install --no-audit
env:
PACKAGE_URL: ${{ steps.repo-info.outputs.url }}
run: |
if npm install --no-audit; then
echo "passed=true" >> "${GITHUB_OUTPUT}"
else
echo "::error ::The dependency installation failed. Visit ${PACKAGE_URL}"
fi

- name: Install Stylelint ${{ matrix.stylelint-version }}
continue-on-error: true
id: install-stylelint
if: ${{ steps.install-dependencies.outputs.passed }}
working-directory: ${{ steps.repo-info.outputs.directory }}
env:
STYLELINT_VERSION: ${{ matrix.stylelint-version }}
PACKAGE_URL: ${{ steps.repo-info.outputs.url }}
run: |
if npm install --no-audit --no-save "${STYLELINT_VERSION}"; then
echo "passed=true" >> "${GITHUB_OUTPUT}"
else
echo "::error ::The Stylelint (${STYLELINT_VERSION}) installation failed. Visit ${PACKAGE_URL}"
fi

- name: Run build
id: build
if: ${{ steps.install-dependencies.outputs.passed && steps.install-stylelint.outputs.passed }}
working-directory: ${{ steps.repo-info.outputs.directory }}
run: npm install --no-audit --no-save ${{ matrix.stylelint-version }}
env:
PACKAGE_URL: ${{ steps.repo-info.outputs.url }}
run: |
if npm run build --if-present; then
echo "passed=true" >> "${GITHUB_OUTPUT}"
else
echo "::error ::The build failed. Visit ${PACKAGE_URL}"
fi

- name: Run test
continue-on-error: true
id: test
if: ${{ steps.install-dependencies.outputs.passed && steps.install-stylelint.outputs.passed && steps.build.outputs.passed }}
working-directory: ${{ steps.repo-info.outputs.directory }}
env:
PACKAGE: ${{ matrix.package }}
PACKAGE_URL: ${{ steps.repo-info.outputs.url }}
run: |
npm test || echo "::error title=${PACKAGE}::The test failed. Visit ${PACKAGE_URL}"
if ! npm test; then
echo "::error ::The test failed. Visit ${PACKAGE_URL}"
fi
Loading