1- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2- # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
1+ # .github/workflows/build.yml
32
4- name : Build
3+ name : Build and Test
54
65on : ["push", "pull_request"]
76
87jobs :
98 test-node :
9+ name : Test on Node.js ${{ matrix.node-version }}
1010 runs-on : ubuntu-latest
1111 strategy :
1212 matrix :
13- node-version : [18.x, 20.x, 22.x] # Node 24 is not an LTS version yet, can be added later if needed.
13+ node-version : [18.x, 20.x, 22.x]
14+
1415 steps :
1516 - name : Checkout repository
1617 uses : actions/checkout@v4
1920 uses : actions/setup-node@v4
2021 with :
2122 node-version : ${{ matrix.node-version }}
23+ cache : ' npm' # Add caching for npm dependencies
2224
2325 - name : Install dependencies
2426 run : npm install
@@ -43,18 +45,21 @@ jobs:
4345 if : matrix.node-version == '22.x'
4446 uses : codecov/codecov-action@v4
4547 with :
46- token : ${{ secrets.CODECOV_TOKEN }} # It's recommended to use a repository upload token
47-
48+ token : ${{ secrets.CODECOV_TOKEN }}
4849
49- # --- New Job for Bun ---
50+ # --- Test on the Bun runtime ---
5051 test-bun :
52+ name : Test on Bun
5153 runs-on : ubuntu-latest
5254 steps :
5355 - name : Checkout repository
5456 uses : actions/checkout@v4
5557
5658 - name : Set up Bun
5759 uses : oven-sh/setup-bun@v1
60+ with :
61+ bun-version : latest # Or a specific version
62+ # Caching is enabled by default with setup-bun
5863
5964 - name : Install dependencies
6065 run : bun install
0 commit comments