Various improvements and fixes to setup-bun (#40)

* Do not save cache on hit
* Support Windows (canary only)
* Support `registry-url` and `scope`
This commit is contained in:
Ashcon Partovi 2023-11-17 15:58:17 -08:00 committed by GitHub
parent 830e319e28
commit a93230df19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 994 additions and 78881 deletions

30
.github/workflows/format.yml vendored Normal file
View file

@ -0,0 +1,30 @@
name: autofix.ci # Must be named this for autofix.ci to work
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Dependencies
run: npm install
- name: Format
run: |
npm run format
npm run build
- name: Commit
uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc

View file

@ -1,37 +1,48 @@
name: Setup Bun
name: Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
setup-bun:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
include:
- os: windows-latest
bun-version: canary
os:
- ubuntu-latest
- macos-latest
bun-version:
- latest
- canary
- "0.5.6"
- "9be68ac2350b965037f408ce4d47c3b9d9a76b63"
- "0.8.1" # last version before 1.0
- "0.x"
- "1.0.0"
- "1.x"
- "1"
- "> 1.0.0"
- "< 2"
# Disable <sha> support for now. This is because Github Artifacts
# expire after 90 days, and we don't have another source of truth yet.
# - "822a00c4d508b54f650933a73ca5f4a3af9a7983" # 1.0.0 commit
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
- id: setup-bun
name: Setup Bun
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: ./
with:
bun-version: ${{ matrix.bun-version }}
- id: verify-bun
name: Verify Bun
- name: Run Bun
run: |
bun --version
setup-bun-from-package-json-version:
@ -49,6 +60,6 @@ jobs:
echo "$(jq '. += {"packageManager": "bun@1.0.0"}' package.json)" > package.json
- name: Setup Bun
uses: ./
- name: Verify Bun
- name: Run Bun
run: |
bun --version