diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..79d10ce4 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,62 @@ +name: windows + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + adapters: + name: Adapter specs on Windows (libxml) + runs-on: windows-latest + + steps: + - uses: actions/checkout@v6 + with: + submodules: "recursive" + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + bundler-cache: false + + - name: Install libxml2 and build tools via MSYS2 + shell: cmd + run: | + C:\msys64\usr\bin\pacman.exe -S --needed --noconfirm ^ + mingw-w64-ucrt-x86_64-libxml2 ^ + mingw-w64-ucrt-x86_64-libiconv ^ + mingw-w64-ucrt-x86_64-zlib ^ + mingw-w64-ucrt-x86_64-ragel ^ + mingw-w64-ucrt-x86_64-make ^ + mingw-w64-ucrt-x86_64-gcc + + - name: Put MSYS2 UCRT64 toolchain on PATH + shell: pwsh + run: | + "PATH=C:\msys64\ucrt64\bin;C:\msys64\usr\bin;$env:PATH" >> $env:GITHUB_ENV + + - name: Configure libxml-ruby build + shell: pwsh + run: | + bundle config build.libxml-ruby --with-xml2-include=C:/msys64/ucrt64/include/libxml2 --with-xml2-lib=C:/msys64/ucrt64/lib --with-iconv-include=C:/msys64/ucrt64/include --with-iconv-lib=C:/msys64/ucrt64/lib + + - name: Generate ragel / ruby-ll outputs in vendored forks + shell: pwsh + run: | + gem install ruby-ll --no-document + rake vendor:prepare + + - name: Install dependencies + run: bundle install --jobs 4 + + - name: Compile vendored native extensions + run: bundle exec rake vendor:compile + + - name: Run adapter specs + run: bundle exec rake spec:adapter diff --git a/Gemfile b/Gemfile index 778c54f6..04dc4395 100644 --- a/Gemfile +++ b/Gemfile @@ -30,7 +30,8 @@ gem "rubocop-performance" gem "rubocop-rake" gem "rubocop-rspec" gem "simplecov", require: false -gem "stackprof" +# stackprof relies on POSIX signals (SIGPROF/sigaction) unavailable on Windows +gem "stackprof" unless Gem.win_platform? gem "tempfile" # Needed by get_process_mem on Windows