oven-sh / setup-bun Goto Github PK
View Code? Open in Web Editor NEWSet up your GitHub Actions workflow with a specific version of Bun
License: MIT License
Set up your GitHub Actions workflow with a specific version of Bun
License: MIT License
I started to get this log on my workflows:
The set-output
command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Do you think this can fixed easily?
We use bun in various parts of the expo/expo repository, e.g. here. Like the node setup action, we use a version selector with a .x
, e.g., node-version: 18.x
.
This seemed to work until some days ago when our CI started failing with the following message:
A quick test showed that using the exact version number does seem to work, but 1.x
or 1.0.x
won't anymore. Is this something that never should have worked, or a bug? ๐
request | response |
---|---|
1.0.x |
|
1.x |
|
1.0.11 |
โ - but big image, see below |
latest |
โ - but big image, see below |
I'm trying out bun to speed up CI installs, but the brick fails silently. If the installation fails, the step should fail.
Context: https://github.com/pixiebrix/pixiebrix-extension/actions/runs/6717134975/job/18254455816
Exposing node_modules
severely degrades the developer experience, especially the push speed and the ability to contribute.
At the moment we'll probably use ncc, since we can't afford to wait for a new bundler, we'll migrate the bundler after the new one.
Title is a bit tongue in cheek.
It doesn't look like there's a way to set a damage file or anything for purposes of a cache in the action.
This is normally configured in the actions/setup-node action on GH actions.
It doesn't look like bun has that, which is a bit disappointing because it feels like there might be an even deeper win here if that was available.
^
ASDF
is a tool for managing language versions in a project, and it uses a .tool-versions
file for managing which language version should be in use.
It has a plugin for it for managing the bun version.
I'd really like if I could tell the setup-bun
action to use the same bun version as the ASDF .tool-versions
file.
This feature is available in similar setup-<lang>
actions.
eg.
setup-ruby
setup-node
The action is downloading 0.5.6
. When I explicitly set bun-version
to 1.0.0, it still downloads 0.5.6
.
Log output:
Run oven-sh/setup-bun@v1
with:
bun-version: 1.0.0
Downloading a new version of Bun: https://bun.sh/download/0.5.6/linux/x64?avx2=true&profile=false
/usr/bin/unzip -o -q /home/runner/work/_temp/aecc4a[3](https://github.com/probablykasper/kyper/actions/runs/6151443142/job/16691722213#step:3:3)7-5cc8-[4](https://github.com/probablykasper/kyper/actions/runs/6151443142/job/16691722213#step:3:4)99d-b88e-3be91f1e9efa
/home/runner/.bun/bin/bun --revision
bun: a fast bundler, transpiler, JavaScript Runtime and package manager for web software.
run ./my-script.ts Run JavaScript with bun, a package.json script, or a bin
x bun-repl Install and execute a package bin (bunx)
init Start an empty Bun project from a blank template
create next ./app Create a new project from a template (bun c)
install Install dependencies for a package.json (bun i)
add @zarfjs/zarf Add a dependency to package.json (bun a)
link Link an npm package globally
remove redux Remove a dependency from package.json (bun rm)
unlink Globally unlink an npm package
pm More commands for managing packages
dev ./a.ts ./b.jsx Start a bun (frontend) Dev Server
bun ./a.ts ./b.jsx Bundle dependencies of input files into a .bun
upgrade Get the latest version of bun
completions Install shell completions for tab-completion
discord Open bun's Discord server
help Print this help menu
/home/runner/.bun/bin/bun --version
0.[5](https://github.com/probablykasper/kyper/actions/runs/6151443142/job/16691722213#step:3:5).[6](https://github.com/probablykasper/kyper/actions/runs/6151443142/job/16691722213#step:3:6)
/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /home/runner/work/kyper/kyper --files-from manifest.txt --use-compress-program zstdmt
Cache Size: ~29 MB (303[7](https://github.com/probablykasper/kyper/actions/runs/6151443142/job/16691722213#step:3:7)[9](https://github.com/probablykasper/kyper/actions/runs/6151443142/job/16691722213#step:3:9)[34](https://github.com/probablykasper/kyper/actions/runs/6151443142/job/16691722213#step:3:35)7 B)
Cache saved successfully
Hey there,
We've noticed recently that on a cold cache this action hangs for over 2 minutes after the "Cache saved successfully" message. This is probably related to the actions/cache package and the Node version (see actions/setup-node#878)
They solved this by exiting early rather than waiting for the cache save promise to resolve: https://github.com/actions/setup-node/pull/917/files
I propose to implement the same fix here, and also as per the node action moving the cache saving to a runs.post
hook so it runs after other steps if the workflow was successful e.g. https://github.com/actions/setup-node/blob/25b062c917b0c75f8b47d8469aff6c94ffd89abb/action.yml#L38-L39
I'm happy to create a PR for this.
I have the following step:
- name: Use Bun v1
uses: oven-sh/setup-bun@v1
with:
registry-url: "https://npm.pkg.github.com"
scope: "@companyName"
In the logs, I get this warning: Unexpected input(s) 'registry-url', 'scope', valid inputs are ['bun-version']
.
There are setup instructions available in the README.md file, but this doesn't seem to reflect what's actually deployed. I can also see some work being done in the commit logs, seems like some runners are throwing an error.
I'm trying to run bun test --coverage --preload ./scripts/test.js
, which does not seem to be recognised.
Hi, I'm using this action to set up Bun in a CI job, and I expected bunx
to be available for subsequent steps after this:
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
Instead I get bunx: command not found
. Is the intention to make bunx
available, and if not, is there a workaround?
Currently the only way to ensure during CI you get the latest version from a major revision using wildcard version
like 1.x (or 1.1.x
for major + minor version pinning) is to disable caching, which is not friendly to the bun download infra, etc.
check-latest
would allow to:
Setting version
to latest is not offering a similar granularity over the version control at CI on GitHub.
This tool works great for Linux or MacOS builds, but doesn't for Windows.
Link from the image: https://bun.sh/download/latest/win32/x64?avx2=true&profile=false
. Indeed it returns the "Not found" response.
Link to github-action: https://github.com/RooTender/augmentator/actions/runs/8507476089
This is the annotation warning I started to receive when using oven-sh/setup-bun@v1
action:
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: oven-sh/setup-bun@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
If you setup a new github project and add a self hosted runner and try to use the task it gets stuck after this:
Downloading a new version of Bun: https://bun.sh/download/1.0.26/linux/x64?avx2=true&profile=false
/usr/bin/unzip -o -q /home/XXX/GHAction/_temp/6c34e31[5](https://github.com/XXX/GHAction/actions/runs/8131459921/job/22220810867#step:3:6)-e774-4d10-b078-4022[6](https://github.com/XXX/GHAction/actions/runs/8131459921/job/22220810867#step:3:7)191e70c
/home/XXX/.bun/bin/bun --revision
1.0.26+c[7](https://github.com/XXX/GHAction/actions/runs/8131459921/job/22220810867#step:3:8)5e76[8](https://github.com/XXX/GHAction/actions/runs/8131459921/job/22220810867#step:3:9)a6
/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /home/XXX/GHAction/projects/RSAS/rsas/rsas --files-from manifest.txt --use-compress-program zstdmt
Cache Size: ~31 MB (32664145 B)
Cache saved successfully
After this it just does nothing
It only works if you then cancel the run and start a new one
My workflow is also pretty simple
name: Build Pipeline
on:
push:
branches: ["main"]
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.26
- name: Build
run: bun run build
The runner is running on Ubuntu 22.04.3 LTS
Here is my neofetch:
.-/+oossssoo+/-. XXX@homelabs1
`:+ssssssssssssssssss+:` -------------
-+ssssssssssssssssssyyssss+- OS: Ubuntu 22.04.3 LTS x86_64
.ossssssssssssssssssdMMMNysssso. Host: PowerEdge R710
/ssssssssssshdmmNNmmyNMMMMhssssss/ Kernel: 5.15.0-94-generic
+ssssssssshmydMMMMMMMNddddyssssssss+ Uptime: 20 days, 20 hours, 58 mins
/sssssssshNMMMyhhyyyyhmNMMMNhssssssss/ Packages: 902 (dpkg), 5 (snap)
.ssssssssdMMMNhsssssssssshNMMMdssssssss. Shell: bash 5.1.16
+sssshhhyNMMNyssssssssssssyNMMMysssssss+ Resolution: 1024x768
ossyNMMMNyMMhsssssssssssssshmmmhssssssso Terminal: /dev/pts/0
ossyNMMMNyMMhsssssssssssssshmmmhssssssso CPU: Intel Xeon E5620 (16) @ 2.393GHz
+sssshhhyNMMNyssssssssssssyNMMMysssssss+ GPU: 08:03.0 Matrox Electronics Systems Ltd. MGA G200eW WPCM450
.ssssssssdMMMNhsssssssssshNMMMdssssssss. Memory: 1218MiB / 64381MiB
/sssssssshNMMMyhhyyyyhdNMMMNhssssssss/
+sssssssssdmydMMMMMMMMddddyssssssss+
/ssssssssssshdmNNNNmyNMMMMhssssss/
.ossssssssssssssssssdMMMNysssso.
-+sssssssssssssssssyyyssss+-
`:+ssssssssssssssssss+:`
.-/+oossssoo+/-.
actions/tool-cache
is for tools, actions/cache
is for build.
https://github.com/actions/toolkit/blob/main/packages/tool-cache/README.md
When running without the node setup the self-hosted runners image throws a Segmentation Fault error 139 when running any bun commands.
To resolve I needed to add the node setup step but it would be ideal if this were not needed.
This is the workaround until unzip is added to the install list and the error above is identified.
After following the docs and reading through this issue i can't get the Github actions to work with using a custom registry.
The config looks like this:
steps:
- uses: actions/checkout@v3
- name: Use Bun
uses: oven-sh/setup-bun@main
with:
bun-version: latest
registry-url: 'https://npm.pkg.github.com/'
scope: '@company'
The install seems to timeout with the message: The job running on runner GitHub Actions 5 has exceeded the maximum execution time of 360 minutes.
. It seems my config should work since it's following the docs.
Any ideas?
I've set up the ci/cd using Github actions as following:
name: Deploy on Test Server
run-name: ${{ github.actor }} is deploying to test server
on:
push:
branches:
- development
jobs:
deploy:
runs-on: test
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Create env file
run: cp ../.env .env.local
- name: Setup bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Generate Build
run: bun run build
- name: Restart process
run: pm2 restart myapp
But, when the setup-bun action can't setup bun without stopping every other process running bun, ci error:
Run oven-sh/setup-bun@v1
with:
bun-version: latest
Downloading a new version of Bun: https://bun.sh/download/latest/linux/x64?avx[2](https://github.com/whatstalk/whatstalk-web/actions/runs/7533224581/job/20505337934#step:5:2)=true&profile=false
/usr/bin/unzip -o -q /usr/apps/_temp/bd9fb8b4-08[3](https://github.com/whatstalk/whatstalk-web/actions/runs/7533224581/job/20505337934#step:5:3)e-[4](https://github.com/whatstalk/whatstalk-web/actions/runs/7533224581/job/20505337934#step:5:5)7f[5](https://github.com/whatstalk/whatstalk-web/actions/runs/7533224581/job/20505337934#step:5:6)-9e[6](https://github.com/whatstalk/whatstalk-web/actions/runs/7533224581/job/20505337934#step:5:7)d-0c4d8cc2430a
Error: Error: ETXTBSY: text file is busy, copyfile '/usr/apps/_temp/3625e59f-8c63-4659-90a9-ede291cca2fc/bun-linux-x64-baseline/bun' -> '/home/marcelokochiyama/.bun/bin/bun'
It is an expected behaviour or it should work even with other apps running with bun on the background?
Run oven-sh/setup-bun@v1
Downloading a new version of Bun: https://bun.sh/download/latest/linux/x64?avx2=true&profile=false
Error: Error: Unexpected HTTP response: 403
Does https://bun.sh/download has some kind of WAF or rate limiting mechanism? When I manually run curl on the runner it displayed <title>Just a moment...</title>
but I coudn't see the reason.
Also I can confirm that directly curl https://github.com/oven-sh/bun/releases/download/bun-v1.0.33/bun-linux-x64-baseline.zip is ok.
P.S. We use self-hosted runners and utilize the cloudflare WARP, but I think it shouldn't be a problem to setup bun.
Hello,
The wrong bun version is downloaded whether the version is specified or not.
It was working fine until very recently (~1h)
I'm always getting v0.5.6
which seems broken for workspaces
I'm using a minimal config
name: CI
on:
pull_request:
push:
jobs:
install:
name: Install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.0
- name: Install Dependencies
run: bun install
- name: Run
run: bun run index.ts
I have a minimal repo here: https://github.com/0xYami/bun-repro-ci-bun-version
Log without version specified (should defaults to latest
): https://github.com/0xYami/bun-repro-ci-bun-version/actions/runs/6151432253/job/16691465674#step:3:30
Log with version specified (should be 1.0.0
): https://github.com/0xYami/bun-repro-ci-bun-version/actions/runs/6151502117/job/16691677799#step:3:31
Pipelines throw the following warning:
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: oven-sh/setup-bun@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Can we update setup-bun to use Node 20?
The v1 tag is not getting updated with new v1.x releases and is therefore stuck on version of setup-bun
from February 2023.
As a result the readme's own usage example does not take benefit of the fixes and recent releases.
edited by xHyroM
look like
https://bun.sh/download/latest/win32/x64?avx2=true&profile=false
zip file is not present in assets! ,
so I have to use previous version other then bun-v1.0.20 for now
Hello!
According to this documentation https://bun.sh/docs/install/cache, Bun stores all downloaded packages from the registry in a global cache at ~/.bun/install/cache
. I want to cache the downloaded packages (global cache) like https://github.com/actions/setup-node#caching-global-packages-data to speed up my workflows. Does Bun handle this by default? Or should I create/store the global cache using actions/cache?
Starting about 30 minutes ago as of nov 17th 14:49 i get an error while using this action. Perhaps you guys changed the download url? Looking forward to hearing from you!
Run oven-sh/setup-bun@v1
Downloading a new version of Bun: https://bun.sh/download/latest/linux/x64?avx2=true&profile=false
Error: Error: Unexpected HTTP response: 404
using version scheme bun-v<num>
seems to work instead e.g. bun-v1.0.1
Hello,
I use setup-bun action in one of my workflow and it fails with a 404 error on the download link in windows environment.
I know this issue has already been filed but it has been marked as resolve even if the problem still persist or reappeared.
Thank you in advance for your answer
This github action is failing with a 404.
Here's the log
Run oven-sh/setup-bun@v1
Downloading a new version of Bun: https://bun.sh/download/latest/linux/x64?avx2=true&profile=false
Error: Error: Unexpected HTTP response: 404
I was using:
- uses: oven-sh/setup-bun@v1
and also tried:
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
both are failing with the same error.
Automatically fetch latest gh actions and download artifact
So I'm getting this error:
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: oven-sh/setup-bun@v1.
And I'm wondering if is it to hard to move to nodejs 20 action?
I'm getting this warning (and I suspect it's also causing intermittent errors) when running 4 parallell Github Actions that all are running a bun install initially:
Failed to save: Unable to reserve cache with key bun-1.0.20-linux-x64-true-false, another job may be creating this cache. More details: Cache already exists. Scope: refs/heads/main, Key: bun-1.0.20-linux-x64-true-false, Version: 4793076103aa823b0a4c97942d7385d4346f77a3c30a0bad6e0f1d748becbab5
The entire job can be seen here (attempt 1 failed on a thing related to mongodb-memory-server which requires a postinstall action to succeed):
https://github.com/kingstinct/zemble/actions/runs/7323721703
Today i discovered an issue with the setup-bun action. We use setup-bun to install the dependencies and then execute the app with node.
I also can see that setup-bun not containerized, which runs in the runner directly, does not have any issues.
e2e:
permissions:
actions: read
contents: read
id-token: write
pull-requests: write
repository-projects: read
services:
mock_server:
image: mockserver/mockserver
env:
IS_E2E: true
MOCKSERVER_LOG_LEVEL: WARN
container:
image: mcr.microsoft.com/playwright:v1.40.0-jammy
steps:
- name: Fix possible git-lfs issues
run: rm -rf .git/hooks/post-checkout
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
Run: actions/checkout@v3
/usr/bin/docker exec b9f03e81ffcc8799fd9d96166dcc7960541b4625d2c2ea2caa4d88730c35ea0f sh -c "cat /etc/*release | grep ^ID"
Found in cache @ /__t/node/20.9.0/x64
Run: oven-sh/setup-bun@v1
/usr/bin/docker exec b9f03e81ffcc8799fd9d96166dcc7960541b4625d2c2ea2caa4d88730c35ea0f sh -c "cat /etc/*release | grep ^ID"
OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: "/__e/node20/bin/node": stat /__e/node20/bin/node: no such file or directory: unknown
I believe the action looks for node in the wrong space when containerized.
Swap out the install action to the install script. See the lastest docs to see how to pin specific versions, if desired:
- name: Setup Bun
run: |
curl -fsSL https://bun.sh/install | bash
Feel free to close this ticket if you cannot reproduce it. I am unsure if this is a big issue or not. It would be nice to use the setup-bun action everywhere but i am fine with the install script workaround.
Temporary fix #72 which can sometimes lead to longer installation times, released in v1.2.1
Recently attempted to use bun using this action and got a 404.
Found the same error at the following CI run of the action.
Here:
https://github.com/oven-sh/setup-bun/actions/runs/6315027566/job/17146629315
Log for reference:
Run ./
Downloading a new version of Bun: https://bun.sh/download/9be68ac2350b965037f408ce4d47c3b9d9a76b63/linux/x64?avx2=true&profile=false
Error: Error: Unexpected HTTP response: 400
Can I use this GitHub Action without previously installing Node.js? E.g.
jobs:
lint:
runs-on: "ubuntu-latest"
steps:
- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
node-version: "lts/*"
- name: "Install Bun"
uses: "oven-sh/setup-bun@v1"
Is the first step necessary?
Side note - would you like to enable Discussions in this repository? I would have opened a discussion instead of an issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.