Skip to content

Commit

Permalink
chore: use working directory for npx semver
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Dec 4, 2023
1 parent 702856a commit 0fe2036
Show file tree
Hide file tree
Showing 27 changed files with 109 additions and 57 deletions.
10 changes: 2 additions & 8 deletions .github/actions/install-latest-npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,8 @@ runs:
shell: bash
env:
NODE_VERSION: ${{ inputs.node }}
working-directory: ${{ runner.temp }}
run: |
set -ex
which npx
npx --version
npm --version
npm exec --yes -- semver -r "1" "1.0.0"
MATCH=""
SPECS=("latest" "next-10" "next-9" "next-8" "next-7" "next-6")
Expand All @@ -46,7 +40,7 @@ runs:
ENGINES=$(npm view npm@$SPEC --json | jq -r '.engines.node')
echo "Checking if node@$NODE_VERSION satisfies npm@$SPEC ($ENGINES)"
if npm exec --yes -- semver -r "$ENGINES" "$NODE_VERSION" > /dev/null; then
if npx semver -r "$ENGINES" "$NODE_VERSION" > /dev/null; then
MATCH=$SPEC
echo "Found compatible version: npm@$MATCH"
break
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Check Git Status
run: node scripts/git-dirty.js
- name: Reset Deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-libnpmaccess.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-libnpmdiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-libnpmexec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-libnpmfund.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-libnpmhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-libnpmorg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-libnpmpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-libnpmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-libnpmsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-libnpmteam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-libnpmversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-npmcli-arborist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-npmcli-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-npmcli-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-npmcli-mock-globals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-npmcli-mock-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-npmcli-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
with:
node-version: 20.x
check-latest: contains('20.x', '.x')
# cache: npm
cache: npm
- name: Check Git Status
run: node scripts/git-dirty.js
- name: Reset Deps
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Check Git Status
run: node scripts/git-dirty.js
- name: Reset Deps
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
# cache: npm
cache: npm
- name: Check Git Status
run: node scripts/git-dirty.js
- name: Reset Deps
Expand Down
Loading

0 comments on commit 0fe2036

Please sign in to comment.