File tree Expand file tree Collapse file tree 3 files changed +24
-7
lines changed Expand file tree Collapse file tree 3 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -169,8 +169,20 @@ jobs:
169169
170170 test-napi :
171171 name : Test NAPI
172- runs-on : ubuntu-latest
172+ strategy :
173+ # Only run on Windows for `main` branch.
174+ matrix :
175+ os : [ubuntu-latest, windows-latest]
176+ is_main : ${{ github.ref_name == 'main' }}
177+ exclude :
178+ - os : windows-latest
179+ is_main : false
180+
181+ runs-on : ${{ matrix.os }}
173182 steps :
183+ - name : Enable long paths on Windows
184+ if : matrix.os == 'windows-latest'
185+ run : git config --system core.longpaths true
174186 - uses : taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
175187 - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
176188 id : filter
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ async function testFixture(fixtureName: string): Promise<void> {
1717 } ) ;
1818}
1919
20- describe ( 'ESLint compatibility' , ( ) => {
20+ describe ( 'ESLint compatibility' , { timeout : 10_000 } , ( ) => {
2121 it ( '`definePlugin` should work' , async ( ) => {
2222 await testFixture ( 'definePlugin' ) ;
2323 } ) ;
Original file line number Diff line number Diff line change 11import { defineConfig } from 'vitest/config' ;
22
3- const { env } = process ;
3+ const { env, platform } = process ;
44const isEnabled = envValue => envValue === 'true' || envValue === '1' ;
5- let exclude ;
5+ const exclude = new Set < string > ( ) ;
66if ( ! isEnabled ( env . RUN_LAZY_TESTS ) ) {
7- exclude = [ 'lazy-deserialization.test.ts' ] ;
8- if ( ! isEnabled ( env . RUN_RAW_TESTS ) && ! isEnabled ( env . RUN_RAW_RANGE_TESTS ) ) exclude . push ( 'parse-raw.test.ts' ) ;
7+ exclude . add ( 'lazy-deserialization.test.ts' ) ;
8+ if ( ! isEnabled ( env . RUN_RAW_TESTS ) && ! isEnabled ( env . RUN_RAW_RANGE_TESTS ) ) exclude . add ( 'parse-raw.test.ts' ) ;
9+ }
10+ // TinyPool doesn't seem to work on Windows with Vitest
11+ // Ref: https://github.com/vitest-dev/vitest/issues/8201
12+ if ( platform === 'win32' ) {
13+ exclude . add ( 'parse-raw.test.ts' ) ;
914}
1015
1116export default defineConfig ( {
1217 test : {
1318 diff : {
1419 expand : false ,
1520 } ,
16- exclude,
21+ exclude : [ ... exclude ] ,
1722 } ,
1823 plugins : [
1924 // Enable Codspeed plugin in CI only
You can’t perform that action at this time.
0 commit comments