feat: use packageManager from package.json as default bun version (#152)
* Initial plan * feat: make packageManager from package.json the default bun version Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com> * test: improve cross-platform compatibility and cleanup in utils tests Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com> * docs: update README to document automatic package.json version detection Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com> * conflicts * ci: setup-bun-from-package-json-without-specified-field * ci: setup-bun-from-package-json-without-specified-field * ci: no cache --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com> Co-authored-by: Jozef Steinhübl <contact@xhyrom.dev>
This commit is contained in:
50
.github/workflows/test.yml
vendored
50
.github/workflows/test.yml
vendored
@@ -32,6 +32,8 @@ jobs:
|
||||
|
||||
- name: Setup Bun
|
||||
uses: ./
|
||||
with:
|
||||
no-cache: true
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
@@ -77,6 +79,7 @@ jobs:
|
||||
id: setup_bun
|
||||
with:
|
||||
bun-version: ${{ matrix.bun-version }}
|
||||
no-cache: true
|
||||
|
||||
- name: ▶️ Run Bun
|
||||
id: run_bun
|
||||
@@ -154,6 +157,53 @@ jobs:
|
||||
uses: ./
|
||||
with:
|
||||
bun-version-file: ${{ matrix.file.file }}
|
||||
no-cache: true
|
||||
|
||||
- name: ⚖️ Compare versions
|
||||
uses: ./.github/actions/compare-bun-version
|
||||
with:
|
||||
bun-version: "1.1.0"
|
||||
|
||||
setup-bun-from-package-json-without-specified-field:
|
||||
name: setup-bun from (${{ matrix.os }}, ${{ matrix.file.name }}) without specified field
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
needs: [remove-cache, tests]
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
- windows-11-arm
|
||||
|
||||
file:
|
||||
- name: package.json (packageManager bun@1.1.0)
|
||||
file: package.json
|
||||
run: |
|
||||
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > package.json
|
||||
|
||||
- name: package.json (packageManager yarn@bun@1.1.0)
|
||||
file: package.json
|
||||
run: |
|
||||
echo "$(jq '. += {"packageManager": "yarn@bun@1.1.0"}' package.json)" > package.json
|
||||
|
||||
- name: package.json (engines bun@1.1.0)
|
||||
file: package.json
|
||||
run: |
|
||||
echo "$(jq '.engines = {"bun": "1.1.0"}' package.json)" > package.json
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
||||
|
||||
- name: 📄 Setup file
|
||||
run: ${{ matrix.file.run }}
|
||||
|
||||
- name: 🛠️ Setup Bun
|
||||
uses: ./
|
||||
with:
|
||||
no-cache: true
|
||||
|
||||
- name: ⚖️ Compare versions
|
||||
uses: ./.github/actions/compare-bun-version
|
||||
|
||||
Reference in New Issue
Block a user