CI: add Windows Server to the matrix #76
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: >- | |
${{ matrix.os }} ruby ${{ matrix.ruby }} ${{ matrix.db }} | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.allow-failure || false }} | |
strategy: | |
matrix: | |
include: | |
# Windows-2025 has Ruby 3.3 and MySQL 8.0 installed | |
- {os: windows-2025} | |
# Windows-2022 has Ruby 3.0 and MySQL 8.0 installed | |
- {os: windows-2022} | |
# On the fail-fast: true, it cancels all in-progress jobs | |
# if any matrix job fails, which we don't want. | |
fail-fast: false | |
env: | |
BUNDLE_WITHOUT: development | |
# reduce MacOS CI time, don't need to clean a runtime that isn't saved | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- if: runner.os == 'Linux' || runner.os == 'macOS' | |
run: sudo echo "127.0.0.1 mysql2gem.example.com" | sudo tee -a /etc/hosts | |
- if: runner.os == 'Windows' | |
run: echo "127.0.0.1 mysql2gem.example.com" | tee -a C:/Windows/System32/drivers/etc/hosts | |
- run: echo 'DB=${{ matrix.db }}' >> $GITHUB_ENV | |
- run: bash ci/setup.sh | |
# Set the verbose option in the Makefile to print compiling command lines. | |
- run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV | |
- if: matrix.ssl | |
run: echo "rake_spec_opts=--with-openssl-dir=$(brew --prefix ${{ matrix.ssl }})" >> $GITHUB_ENV | |
- run: bundle exec rake spec -- $rake_spec_opts |