Skip to content

Commit

Permalink
ci: switch Yarn to Bun
Browse files Browse the repository at this point in the history
* For this project, it's faster to Bun install without a cache than to restore a cache using Yarn.
* For the publish workflow, we still need the `setup-node` action. It uses the npm CLI to publish the package to NPM with provenance.
  • Loading branch information
metonym committed Apr 11, 2024
1 parent 72ddb67 commit da2490a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,18 @@ jobs:

steps:
- uses: actions/checkout@v4

- uses: actions/cache@v4
id: yarn-cache
- uses: oven-sh/setup-bun@v1
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
bun-version: 1.1.3

- name: Install dependencies
run: yarn install
run: bun install --no-scripts

- name: Build the library
run: yarn build
run: bun run build

- name: Run unit tests
run: yarn test
run: bun test

# Only trigger deploy if previous steps pass and branch is main
- name: Deploy docs
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,22 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v4

# The Node.js action is required to use npm.
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.3

- name: Install dependencies
run: yarn install
run: bun install --no-scripts

- name: Build package
run: yarn build
run: bun run build

- name: Publish package
env:
Expand Down

0 comments on commit da2490a

Please sign in to comment.