Skip to content

Commit fdd5e8a

Browse files
committed
chore(ci): fix JS ci
1 parent 83b2171 commit fdd5e8a

2 files changed

Lines changed: 49 additions & 49 deletions

File tree

.github/workflows/build-android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ on:
88
- '.github/workflows/build-android.yml'
99
- 'package/cpp/**'
1010
- 'package/android/**'
11-
- 'examples/AppExampleFabric/android/**'
11+
- 'examples/**/android/**'
1212
- 'bun.lock'
1313
pull_request:
1414
paths:
1515
- '.github/workflows/build-android.yml'
1616
- 'package/cpp/**'
1717
- 'package/android/**'
18-
- 'examples/AppExampleFabric/android/**'
18+
- 'examples/**/android/**'
1919
- 'bun.lock'
2020

2121
jobs:

.github/workflows/validate-js.yml

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,100 +9,100 @@ on:
99
- 'package/src/**'
1010
- 'package/*.json'
1111
- 'package/*.js'
12-
- 'package/*.lock'
13-
- 'package/example/src/**'
14-
- 'package/example/*.json'
15-
- 'package/example/*.js'
16-
- 'package/example/*.lock'
17-
- 'package/example/*.tsx'
12+
- 'bun.lock'
13+
- 'examples/**/*.json'
14+
- 'examples/**/*.js'
15+
- 'examples/**/*.ts'
16+
- 'examples/**/*.tsx'
1817
pull_request:
1918
paths:
2019
- '.github/workflows/validate-js.yml'
2120
- 'package/src/**'
2221
- 'package/*.json'
2322
- 'package/*.js'
24-
- 'package/*.lock'
25-
- 'package/example/src/**'
26-
- 'package/example/*.json'
27-
- 'package/example/*.js'
28-
- 'package/example/*.lock'
29-
- 'package/example/*.tsx'
23+
- 'bun.lock'
24+
- 'examples/**/*.json'
25+
- 'examples/**/*.js'
26+
- 'examples/**/*.ts'
27+
- 'examples/**/*.tsx'
3028

3129
jobs:
3230
compile:
3331
name: Compile JS (tsc)
3432
runs-on: ubuntu-latest
35-
defaults:
36-
run:
37-
working-directory: ./package
3833
steps:
3934
- uses: actions/checkout@v4
4035

36+
- name: Setup Bun
37+
uses: oven-sh/setup-bun@v2
38+
with:
39+
bun-version: latest
40+
4141
- name: Install reviewdog
4242
uses: reviewdog/action-setup@v1
4343

44-
- name: Get yarn cache directory path
45-
id: yarn-cache-dir-path
46-
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
47-
- name: Restore node_modules from cache
44+
- name: Restore bun cache
4845
uses: actions/cache@v4
49-
id: yarn-cache
5046
with:
51-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
52-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
47+
path: ~/.bun/install/cache
48+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
5349
restore-keys: |
54-
${{ runner.os }}-yarn-
50+
${{ runner.os }}-bun-
5551
56-
- name: Install node_modules
57-
run: yarn install --immutable
52+
- name: Install dependencies
53+
run: bun install --frozen-lockfile
5854

5955
- name: Run TypeScript # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m
56+
working-directory: package
6057
run: |
61-
yarn typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee
58+
bun run typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee
6259
env:
6360
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6461

65-
- name: Run TypeScript in example/ # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m
62+
- name: Run TypeScript in example app # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m
63+
working-directory: examples/Shared
6664
run: |
67-
cd example && yarn typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee && cd ..
65+
bun run typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee
6866
env:
6967
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7068

7169
lint:
7270
name: Lint JS (eslint, prettier)
7371
runs-on: ubuntu-latest
74-
defaults:
75-
run:
76-
working-directory: ./package
7772
steps:
7873
- uses: actions/checkout@v4
7974

80-
- name: Get yarn cache directory path
81-
id: yarn-cache-dir-path
82-
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
83-
- name: Restore node_modules from cache
75+
- name: Setup Bun
76+
uses: oven-sh/setup-bun@v2
77+
with:
78+
bun-version: latest
79+
80+
- name: Restore bun cache
8481
uses: actions/cache@v4
85-
id: yarn-cache
8682
with:
87-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
88-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
83+
path: ~/.bun/install/cache
84+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
8985
restore-keys: |
90-
${{ runner.os }}-yarn-
86+
${{ runner.os }}-bun-
9187
92-
- name: Install node_modules
93-
run: yarn install --immutable
88+
- name: Install dependencies
89+
run: bun install --frozen-lockfile
9490

9591
- name: Run ESLint
96-
run: yarn lint -f @jamesacarr/github-actions
92+
working-directory: package
93+
run: bun run lint -f @jamesacarr/github-actions
9794

9895
- name: Run ESLint with auto-fix
99-
run: yarn lint --fix
96+
working-directory: package
97+
run: bun run lint --fix
10098

101-
- name: Run ESLint in example/
102-
run: cd example && yarn lint -f @jamesacarr/github-actions && cd ..
99+
- name: Run ESLint in example app
100+
working-directory: examples/AppExampleFabric
101+
run: bun run lint -f @jamesacarr/github-actions
103102

104-
- name: Run ESLint in example/ with auto-fix
105-
run: cd example && yarn lint --fix && cd ..
103+
- name: Run ESLint in example app with auto-fix
104+
working-directory: examples/AppExampleFabric
105+
run: bun run lint --fix
106106

107107
- name: Verify no files have changed after auto-fix
108108
run: git diff --exit-code HEAD

0 commit comments

Comments
 (0)