Skip to content
Merged
Changes from 5 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
30 changes: 23 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
- "utils/**/*.ts"
- "utils/package.json"
- "package.json"
- "package-lock.json"
- ".github/workflows/ci.yml"
pull_request:
branches: ["*"]
Expand All @@ -27,7 +26,6 @@ on:
- "utils/**/*.ts"
- "utils/**/package.json"
- "package.json"
- "package-lock.json"
- ".github/workflows/ci.yml"
types:
- opened
Expand Down Expand Up @@ -62,11 +60,10 @@ jobs:

lint-and-types:
name: Lint & types
runs-on: ubuntu-slim

if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}

runs-on: ubuntu-slim

steps:
# FIXME https://github.com/step-security/harden-runner/issues/627
# - name: Harden the runner (Audit all outbound calls)
Expand All @@ -85,11 +82,10 @@ jobs:

test:
name: Codemod JSSG tests
runs-on: ${{ matrix.os }}

if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
Expand All @@ -106,6 +102,7 @@ jobs:

- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
show-progress: false

Expand All @@ -117,4 +114,23 @@ jobs:
node-version-file: ".nvmrc"

- run: npm ci
- run: node --run test

- name: Run tests (determined by changeset)
shell: bash
run: >
changed_paths=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }})

# run everything?
if echo "$changed_paths" | grep -qE '^(package\.json|\.github/workflows/ci\.yml|utils/)$'; then
npm run test --workspaces
exit 0
fi

# run for specific workspace(s)
npm run test $(
echo "$changed_paths" \
| grep '^recipes/'
| cut -d/ -f1,2
| sort -u
| sed 's/^/--workspace=/'
)
Loading