1
- on : [workflow_call]
1
+ on :
2
+ workflow_call :
3
+ inputs :
4
+ run-on-windows :
5
+ required : false
6
+ type : boolean
7
+ default : false
2
8
3
9
permissions : {}
4
10
5
- env :
6
- WINDOWS_USERPROFILE : " D:"
7
- WINDOWS_BUN_CACHE_DIR : ' D:\.bun\install\cache'
8
-
9
11
jobs :
10
12
test :
11
13
name : 🧪 Tests
12
14
strategy :
13
15
fail-fast : false
14
16
matrix :
15
- os : [ubuntu-latest, windows-latest]
17
+ os :
18
+ - ubuntu-latest
19
+ - ${{ inputs.run-on-windows && 'windows-latest' || '' }}
20
+ exclude :
21
+ - os : " "
16
22
17
23
runs-on : ${{ matrix.os }}
18
24
19
25
steps :
20
- # https://ichard26.github.io/blog/2025/03/faster-pip-ci-on-windows-d-drive/#moving-temp-to-the-d-drive
21
- - name : 🗂️ Configure Temp Directory (Windows)
22
- if : runner.os == 'Windows'
23
- shell : pwsh
24
- run : |
25
- $TEMP_DIR = "$env:WINDOWS_USERPROFILE\Temp"
26
- # Create temp dir
27
- New-Item -ItemType Directory -Force -Path $TEMP_DIR | Out-Null
28
-
29
- "TEMP=$TEMP_DIR" >> $env:GITHUB_ENV
30
- "TMP=$TEMP_DIR" >> $env:GITHUB_ENV
31
-
32
- - name : 🔓 Disable Windows Defender (Windows)
33
- if : runner.os == 'Windows'
34
- shell : powershell
35
- run : Set-MpPreference -DisableRealtimeMonitoring $true
36
-
37
26
- name : 📥 Checkout
38
27
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39
28
with :
@@ -52,25 +41,19 @@ jobs:
52
41
53
42
- name : 🔧 Setup Bun
54
43
uses : oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2
55
- env :
56
- USERPROFILE : ${{ env.WINDOWS_USERPROFILE }}
57
44
with :
58
45
bun-version : latest
59
46
60
- # Run only on Windows because on Linux there are no problems with slow package installation
47
+ # Run only on Windows because on Linux there are no problems with slow package installation
61
48
- name : 📥 Cache Bun dependencies (Windows)
62
49
if : runner.os == 'Windows'
63
50
uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
64
- env :
65
- BUN_INSTALL_CACHE_DIR : ${{ runner.os == 'Windows' && env.WINDOWS_BUN_CACHE_DIR || '' }}
66
51
with :
67
- path : ${{ env.BUN_INSTALL_CACHE_DIR }}
52
+ path : ~\.bun
68
53
key : ${{ matrix.os }}-bun-${{ hashFiles('**/bun.lock') }}
69
- restore-keys : ${{ matrix.os }}-bun-
54
+ restore-keys : ${{ matrix.os }}-bun-cache-
70
55
71
56
- name : 📦 Install dependencies
72
- env :
73
- BUN_INSTALL_CACHE_DIR : ${{ runner.os == 'Windows' && env.WINDOWS_BUN_CACHE_DIR || '' }}
74
57
run : bun install --production --frozen-lockfile --prefer-offline --ignore-scripts --omit=optional
75
58
76
59
- name : 🧪 Run tests
0 commit comments