Skip to content

Commit

Permalink
ci: lint and test v-next packages lazily
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Aug 2, 2024
1 parent 5d6c0cd commit 0cc2836
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions .github/workflows/v-next-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- "**"
paths:
- ".github/workflows/v-next-ci.yml"
- "v-next/**"
- "config-v-next/**"
workflow_dispatch:
Expand Down Expand Up @@ -42,16 +43,42 @@ jobs:
name: List packages
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.list.outputs.packages }}
packages: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v4
- id: list
- uses: actions/setup-node@v4
with:
node-version: 22
- run: yq -p yaml -o json pnpm-lock.yaml | tee pnpm-lock.json
- id: generate
env:
PACKAGE_IGNORE: |
[
".",
"packages/",
"v-next/example-project"
]
COMMON_FILTERS: |
[
".github/workflows/v-next-ci.yml",
"config-v-next/**"
]
run: |
echo "packages=$(ls -d v-next/* | xargs -n 1 basename | grep -v example-project | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
echo "filters<<EOF" >> $GITHUB_OUTPUT
node scripts/generate-filters.js |
yq -Po yaml 'with_entries(.key |= sub("^v-next/", ""))' |
tee -a $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- id: filter
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
with:
filters: ${{ steps.generate.outputs.filters }}

lint:
needs: list-packages

if: needs.list-packages.outputs.packages != '[]'

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -83,6 +110,8 @@ jobs:
ci:
needs: list-packages

if: needs.list-packages.outputs.packages != '[]'

strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit 0cc2836

Please sign in to comment.