Skip to content

Commit 9ae816b

Browse files
authored
Merge pull request #471 from brazilian-utils/tooling
chore: migrate to vite+
2 parents 6a800a3 + 110252b commit 9ae816b

99 files changed

Lines changed: 6105 additions & 2312 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
version: 2
22
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
37
- package-ecosystem: "npm"
48
directory: "/"
59
schedule:

.github/workflows/build.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: ${{ github.event_name != 'pull_request' }}
12+
13+
permissions:
14+
contents: read
415

516
jobs:
617
build:
718
name: Build
819
runs-on: ubuntu-latest
20+
timeout-minutes: 15
921

1022
steps:
1123
- name: Checkout code
12-
uses: actions/checkout@v4
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1325

14-
- name: Install Bun
15-
uses: oven-sh/setup-bun@v1
16-
17-
- name: Install dependencies
18-
run: bun install
26+
- name: Setup Vite+
27+
uses: voidzero-dev/setup-vp@v1
28+
with:
29+
cache: true
1930

2031
- name: Run build
21-
run: bun run build
32+
run: vp run build
33+
34+
- name: Upload build artifact
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: dist
38+
path: dist

.github/workflows/check.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
name: Check
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: ${{ github.event_name != 'pull_request' }}
12+
13+
permissions:
14+
contents: read
415

516
jobs:
617
check:
718
name: Check
819
runs-on: ubuntu-latest
20+
timeout-minutes: 15
921

1022
steps:
1123
- name: Checkout code
12-
uses: actions/checkout@v4
13-
14-
- name: Install Bun
15-
uses: oven-sh/setup-bun@v1
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1625

17-
- name: Install dependencies
18-
run: bun install
26+
- name: Setup Vite+
27+
uses: voidzero-dev/setup-vp@v1
28+
with:
29+
cache: true
1930

20-
- name: Run tests
21-
run: bun run ci
31+
- name: Run checks
32+
run: npm run check

.github/workflows/tests.yml

Lines changed: 57 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,109 @@
11
name: Tests
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: ${{ github.event_name != 'pull_request' }}
12+
13+
permissions:
14+
contents: read
415

516
jobs:
617
test-node:
718
name: Test on Node.js (${{ matrix.node-version }})
819
runs-on: ubuntu-latest
20+
timeout-minutes: 20
921
strategy:
1022
matrix:
11-
node-version: [18, 20, 22]
23+
node-version: [20, 22, 24]
1224

1325
steps:
1426
- name: Checkout code
15-
uses: actions/checkout@v4
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1628

17-
- name: Use Node.js ${{ matrix.node-version }}
18-
uses: actions/setup-node@v4
29+
- name: Setup Node.js
30+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1931
with:
2032
node-version: ${{ matrix.node-version }}
2133

22-
- name: Install dependencies
23-
run: npm install
34+
- name: Setup Vite+
35+
uses: voidzero-dev/setup-vp@v1
36+
with:
37+
cache: true
2438

2539
- name: Run tests
26-
run: npm run test
40+
run: vp test
2741

2842
test-bun:
2943
name: Test on Bun
3044
runs-on: ubuntu-latest
45+
timeout-minutes: 15
3146

3247
steps:
3348
- name: Checkout code
34-
uses: actions/checkout@v4
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3550

36-
- name: Install Bun
37-
uses: oven-sh/setup-bun@v1
51+
- name: Setup Bun
52+
uses: oven-sh/setup-bun@v2
3853

39-
- name: Install dependencies
40-
run: bun install
54+
- name: Run tests
55+
run: bun test src
56+
57+
test-deno:
58+
name: Test on Deno
59+
runs-on: ubuntu-latest
60+
timeout-minutes: 15
61+
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
65+
66+
- name: Setup Deno
67+
uses: denoland/setup-deno@v2
68+
with:
69+
deno-version: v2.x
4170

4271
- name: Run tests
43-
run: bun test
72+
run: deno test --unstable-sloppy-imports --allow-net src
4473

4574
test-browsers:
4675
name: Test on Browsers (${{ matrix.browser }})
4776
runs-on: ubuntu-latest
77+
timeout-minutes: 20
4878
strategy:
4979
matrix:
5080
browser: [edge, chrome, firefox]
5181

5282
steps:
5383
- name: Checkout code
54-
uses: actions/checkout@v4
84+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5585

56-
- name: Install dependencies
57-
run: npm install
86+
- name: Setup Vite+
87+
uses: voidzero-dev/setup-vp@v1
88+
with:
89+
cache: true
5890

5991
- name: Run tests in ${{ matrix.browser }}
60-
run: npm run test:${{ matrix.browser }}-browser
92+
run: vp test --browser=${{ matrix.browser }}
6193

6294
test-safari:
6395
name: Test on Browsers (safari)
6496
runs-on: macos-latest
97+
timeout-minutes: 25
6598

6699
steps:
67100
- name: Checkout code
68-
uses: actions/checkout@v4
101+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
69102

70-
- name: Install dependencies
71-
run: npm install
103+
- name: Setup Vite+
104+
uses: voidzero-dev/setup-vp@v1
105+
with:
106+
cache: true
72107

73108
- name: Run tests in Safari
74-
run: npm run test:safari-browser
109+
run: vp test --browser=safari --browser.headless=false

.release-it.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"release": true
55
},
66
"hooks": {
7-
"before:init": ["bun run ci", "bun run test"],
8-
"after:bump": "bun run build",
7+
"before:init": ["vp check", "vp test"],
8+
"after:bump": "vp run build",
99
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
1010
}
1111
}

0 commit comments

Comments
 (0)