Skip to content

Commit

Permalink
Support repository sub directory (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous authored Jul 12, 2024
1 parent 47e47bb commit ab0a10f
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/test-ecosystem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ jobs:
package:
# In alphabetical order
- '@1024pix/stylelint-config-rational-order'
- '@csstools/stylelint-at-risk'
- '@csstools/stylelint-no-at-nest-rule'
- '@csstools/stylelint-no-invalid-at-import-rules-when-bundling'
- '@double-great/stylelint-a11y'
- '@mozaic-ds/stylelint-plugin-mozaic'
- '@namics/stylelint-bem'
- '@o3r/stylelint-plugin'
- '@ronilaukkarinen/stylelint-a11y'
- '@shopify/stylelint-plugin'
- '@stylistic/stylelint-plugin'
- 'stylelint-8-point-grid'
- 'stylelint-a11y'
- 'stylelint-at-rule-no-children'
- 'stylelint-browser-compat'
- 'stylelint-color-format'
- 'stylelint-config-rational-order'
Expand Down Expand Up @@ -95,16 +96,25 @@ jobs:
env:
PACKAGE: ${{ matrix.package }}
run: |
raw_url=$(npm view "${PACKAGE}" 'repository.url')
url=$(npm repo --browser=false --json "${PACKAGE}" | jq -r '.url')
echo "URL: ${url}"
echo "url=${url}" >> "${GITHUB_OUTPUT}"
fullname=$(echo "${raw_url}" | sed -E 's/.*github.com\/([^/]+\/[^/]+)\.git$/\1/')
fullname=$(echo "${url}" | sed -E 's/.*github.com\/([^/]+\/[^/]+).*/\1/')
echo "Fullname: ${fullname}"
echo "fullname=${fullname}" >> "${GITHUB_OUTPUT}"
url=$(echo "${raw_url}" | sed -E 's/^git\+//' | sed -E 's/\.git$//' | sed -E 's/^git:/https:/')
echo "URL: ${url}"
echo "url=${url}" >> "${GITHUB_OUTPUT}"
directory=$(npm view "${PACKAGE}" 'repository.directory')
echo "Directory: ${directory}"
echo "directory=${directory}" >> "${GITHUB_OUTPUT}"
# TODO: Add repo info to https://github.com/3846masa/stylelint-browser-compat
if [[ "${url}" == 'null' ]]; then
echo "url=https://github.com/3846masa/stylelint-browser-compat" >> "${GITHUB_OUTPUT}"
echo "fullname=3846masa/stylelint-browser-compat" >> "${GITHUB_OUTPUT}"
fi
- name: Checkout ${{ steps.repo-info.outputs.url }}
- name: Checkout ${{ steps.repo-info.outputs.fullname }}
uses: actions/checkout@v4
with:
repository: ${{ steps.repo-info.outputs.fullname }}
Expand All @@ -131,14 +141,17 @@ jobs:
- name: Install dependencies
continue-on-error: true
working-directory: ${{ steps.repo-info.outputs.directory }}
run: npm install --no-audit

- name: Install Stylelint ${{ matrix.stylelint-version }}
continue-on-error: true
working-directory: ${{ steps.repo-info.outputs.directory }}
run: npm install --no-audit --no-save ${{ matrix.stylelint-version }}

- name: Run test
continue-on-error: true
working-directory: ${{ steps.repo-info.outputs.directory }}
env:
PACKAGE: ${{ matrix.package }}
PACKAGE_URL: ${{ steps.repo-info.outputs.url }}
Expand Down

0 comments on commit ab0a10f

Please sign in to comment.