Skip to content

Commit cedf10e

Browse files
authored
chore: misc repo update, use bun for everything (#193)
1 parent 5057bd3 commit cedf10e

File tree

16 files changed

+23123
-33334
lines changed

16 files changed

+23123
-33334
lines changed

.github/workflows/format.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@ jobs:
1212
- name: Checkout code
1313
uses: actions/checkout@v4
1414

15-
- name: Set Node.js 18.x
16-
uses: actions/setup-node@v3
17-
with:
18-
node-version: 18
15+
- uses: oven-sh/setup-bun@v2
1916

2017
- name: Install
21-
run: yarn --frozen-lockfile
18+
run: bun install
2219

2320
- name: Check formatting with Prettier
24-
run: npx prettier --check .
21+
run: bun run format:check

.github/workflows/integration-test-workflow.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ jobs:
3131
ref: ${{ github.event.pull_request.head.sha }}
3232
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
3333
fetch-depth: 0
34+
filter: tree:0
3435

3536
- uses: actions/checkout@v4
3637
name: Checkout [Default Branch]
3738
if: ${{ github.event_name != 'pull_request' }}
3839
with:
3940
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
4041
fetch-depth: 0
42+
filter: tree:0
4143

4244
- name: Derive appropriate SHAs for base and head for `nx affected` commands
4345
uses: ./
@@ -46,6 +48,7 @@ jobs:
4648

4749
- name: Verify default PR Workflow
4850
if: ${{ github.event_name == 'pull_request' }}
51+
# Use node for this to be most representative of the user's runtime environment
4952
run: |
5053
BASE_SHA=$(echo $(git merge-base origin/${{github.base_ref}} HEAD))
5154
HEAD_SHA=$(git rev-parse HEAD)
@@ -54,6 +57,7 @@ jobs:
5457
5558
- name: Verify default Push Workflow
5659
if: ${{ github.event_name != 'pull_request' }}
60+
# Use node for this to be most representative of the user's runtime environment
5761
run: |
5862
if git merge-base --is-ancestor $NX_BASE HEAD; then
5963
BASE_SHA=$NX_BASE;

.github/workflows/test.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,33 @@ jobs:
2727
with:
2828
ref: ${{ github.event.pull_request.head.sha }}
2929
fetch-depth: 0
30+
filter: tree:0
3031

3132
- uses: actions/checkout@v4
3233
name: Checkout [Push]
3334
if: ${{ github.event_name != 'pull_request' }}
3435
with:
3536
fetch-depth: 0
37+
filter: tree:0
3638

37-
- name: Set Node.js 18.x
38-
uses: actions/setup-node@v3
39-
with:
40-
node-version: 18
39+
- uses: oven-sh/setup-bun@v2
4140

4241
- name: Install
43-
run: yarn --frozen-lockfile
42+
run: bun install
4443

4544
- name: Compile
46-
run: yarn build
45+
run: bun run build
4746

4847
- name: Test default PR Workflow
4948
if: github.event_name == 'pull_request'
5049
uses: ./
5150
with:
5251
main-branch-name: ${{ github.base_ref }}
52+
5353
- name: Verify default PR Workflow
5454
if: github.event_name == 'pull_request'
5555
shell: bash
56+
# Use node for this to be most representative of the user's runtime environment
5657
run: |
5758
BASE_SHA=$(echo $(git merge-base origin/${{github.base_ref}} HEAD))
5859
HEAD_SHA=$(git rev-parse HEAD)
@@ -64,9 +65,11 @@ jobs:
6465
uses: ./
6566
with:
6667
main-branch-name: ${{ github.ref_name }}
68+
6769
- name: Verify default Push Workflow
6870
if: github.event_name != 'pull_request'
6971
shell: bash
72+
# Use node for this to be most representative of the user's runtime environment
7073
run: |
7174
if git merge-base --is-ancestor $NX_BASE HEAD; then
7275
BASE_SHA=$NX_BASE;

.husky/pre-commit

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
1+
bunx --no-install lint-staged --allow-empty
32

4-
npx --no-install lint-staged --allow-empty
5-
6-
node tools/pre-commit.js
3+
bun tools/pre-commit.ts

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Contributing
2+
3+
## Prerequisites
4+
5+
For development purposes, this repo uses `bun` as a package manager, bundler and TypeScript script runner.
6+
7+
You can install `bun` by following the instruction on https://bun.com/
8+
9+
## Development
10+
11+
- Run `bun install` to install the dependencies.
12+
- Run `bun run build` to build the action.
13+
- Run `bun run format` to format the code. This is also done automatically by the pre-commit hook (please do not skip it).
14+
115
# Notes to Admins
216

317
In order to publish a new version of the action, simply update the "version" in the package.json and merge into the main branch.

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
<p style="text-align: center;"><img src=".github/assets/nx.png"
2-
width="100%" alt="Nx - Smart, Extensible Build Framework"></p>
1+
<p style="text-align: center;">
2+
<picture>
3+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
4+
<img alt="Nx - Smart Repos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5+
</picture>
6+
</p>
37

48
<h1 align="center">Set SHAs Action</h1>
59

@@ -13,9 +17,7 @@ width="100%" alt="Nx - Smart, Extensible Build Framework"></p>
1317
- [Problem](#problem)
1418
- [License](#license)
1519

16-
**NOTE:** This documentation is for version `2.x.x+` which now uses the GitHub API to track successful workflows. You can find documentation for version `1.x.x` which used GIT tags [here](https://github.com/nrwl/nx-set-shas/blob/v1/README.md).
17-
18-
**NOTE:** The `v4` does no longer support deprecated Node versions. Supported version is `Node v18+`.
20+
**NOTE:** This documentation is for version `2.x.x` and later which now uses the GitHub API to track successful workflows. You can find documentation for version `1.x.x` which used GIT tags [here](https://github.com/nrwl/nx-set-shas/blob/v1/README.md).
1921

2022
## Example Usage
2123

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ outputs:
4040

4141
runs:
4242
using: 'node20'
43-
main: 'dist/index.js'
43+
main: 'dist/nx-set-shas.js'
4444

4545
branding:
4646
icon: 'terminal'

0 commit comments

Comments
 (0)