|
9 | 9 | - 'package/src/**' |
10 | 10 | - 'package/*.json' |
11 | 11 | - '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' |
18 | 17 | pull_request: |
19 | 18 | paths: |
20 | 19 | - '.github/workflows/validate-js.yml' |
21 | 20 | - 'package/src/**' |
22 | 21 | - 'package/*.json' |
23 | 22 | - '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' |
30 | 28 |
|
31 | 29 | jobs: |
32 | 30 | compile: |
33 | 31 | name: Compile JS (tsc) |
34 | 32 | runs-on: ubuntu-latest |
35 | | - defaults: |
36 | | - run: |
37 | | - working-directory: ./package |
38 | 33 | steps: |
39 | 34 | - uses: actions/checkout@v4 |
40 | 35 |
|
| 36 | + - name: Setup Bun |
| 37 | + uses: oven-sh/setup-bun@v2 |
| 38 | + with: |
| 39 | + bun-version: latest |
| 40 | + |
41 | 41 | - name: Install reviewdog |
42 | 42 | uses: reviewdog/action-setup@v1 |
43 | 43 |
|
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 |
48 | 45 | uses: actions/cache@v4 |
49 | | - id: yarn-cache |
50 | 46 | 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') }} |
53 | 49 | restore-keys: | |
54 | | - ${{ runner.os }}-yarn- |
| 50 | + ${{ runner.os }}-bun- |
55 | 51 |
|
56 | | - - name: Install node_modules |
57 | | - run: yarn install --immutable |
| 52 | + - name: Install dependencies |
| 53 | + run: bun install --frozen-lockfile |
58 | 54 |
|
59 | 55 | - name: Run TypeScript # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m |
| 56 | + working-directory: package |
60 | 57 | 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 |
62 | 59 | env: |
63 | 60 | REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
64 | 61 |
|
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 |
66 | 64 | 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 |
68 | 66 | env: |
69 | 67 | REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
70 | 68 |
|
71 | 69 | lint: |
72 | 70 | name: Lint JS (eslint, prettier) |
73 | 71 | runs-on: ubuntu-latest |
74 | | - defaults: |
75 | | - run: |
76 | | - working-directory: ./package |
77 | 72 | steps: |
78 | 73 | - uses: actions/checkout@v4 |
79 | 74 |
|
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 |
84 | 81 | uses: actions/cache@v4 |
85 | | - id: yarn-cache |
86 | 82 | 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') }} |
89 | 85 | restore-keys: | |
90 | | - ${{ runner.os }}-yarn- |
| 86 | + ${{ runner.os }}-bun- |
91 | 87 |
|
92 | | - - name: Install node_modules |
93 | | - run: yarn install --immutable |
| 88 | + - name: Install dependencies |
| 89 | + run: bun install --frozen-lockfile |
94 | 90 |
|
95 | 91 | - name: Run ESLint |
96 | | - run: yarn lint -f @jamesacarr/github-actions |
| 92 | + working-directory: package |
| 93 | + run: bun run lint -f @jamesacarr/github-actions |
97 | 94 |
|
98 | 95 | - name: Run ESLint with auto-fix |
99 | | - run: yarn lint --fix |
| 96 | + working-directory: package |
| 97 | + run: bun run lint --fix |
100 | 98 |
|
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 |
103 | 102 |
|
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 |
106 | 106 |
|
107 | 107 | - name: Verify no files have changed after auto-fix |
108 | 108 | run: git diff --exit-code HEAD |
0 commit comments