Skip to content

Commit

Permalink
fix: turborepo integration test glob (#3702)
Browse files Browse the repository at this point in the history
Expanding the patterns to include any changes to the `cli` directory as
well as changing `crates/turborepo*` to `creates/turborepo*/**` which
seems to be what we want.

Testing:
Under the hood get-diff-action [uses
minimatch](https://github.com/technote-space/get-diff-action#usage) for
matching patterns against `git diff`. I quick wrote a test script to
verify these patterns should get us what we want:
```
const { minimatch } = require("minimatch")

const paths = [
'crates/turborepo',
'crates/turborepo-ffi',
'crates/turborepo-lib/src/shim.rs',
'crates/turborepo/Cargo.toml',
]
for (const pat of ['crates/turborepo*', 'crates/turborepo*/**']) {
    for (const path of paths) {
        console.log(`${pat} matches ${path}: ${minimatch(path, pat)}`)
    }
}
```
Output:
```
"crates/turborepo* matches crates/turborepo: true"
"crates/turborepo* matches crates/turborepo-ffi: true"
"crates/turborepo* matches crates/turborepo-lib/src/shim.rs: false"
"crates/turborepo* matches crates/turborepo/Cargo.toml: false"
"crates/turborepo*/** matches crates/turborepo: false"
"crates/turborepo*/** matches crates/turborepo-ffi: false"
"crates/turborepo*/** matches crates/turborepo-lib/src/shim.rs: true"
"crates/turborepo*/** matches crates/turborepo/Cargo.toml: true"
```
  • Loading branch information
chris-olszewski committed Feb 8, 2023
1 parent a44847f commit b2adfc5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ jobs:
uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
cli/**
crates/turborepo*
crates/turborepo*/**
crates/turbo-updater
Cargo.lock
Expand Down

0 comments on commit b2adfc5

Please sign in to comment.