Add CI workflow #4
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
ruby-version: | |
- "2.7" | |
- "3.0" | |
- "3.1" | |
- "3.2" | |
- "3.3" | |
- "3.4" | |
# exclude: | |
# - os: windows-latest | |
# ruby-version: "3.2" | |
steps: | |
- run: | | |
echo "Commit msg: ${{ github.event.head_commit.message }}" | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby & Rust | |
uses: oxidize-rb/actions/setup-ruby-and-rust@main | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
rubygems: "3.3.26" | |
bundler-cache: true | |
cargo-cache: true | |
cache-version: v5 | |
- name: Compile extension | |
run: bundle exec rake compile | |
- name: Run ruby tests | |
run: bundle exec rake spec | |
- name: Run ruby tests (hard-mode with GC.stress) | |
run: bundle exec rake spec | |
env: | |
GC_STRESS: "true" | |
- name: Lint rust | |
run: cargo clippy -- -D warnings && cargo fmt --check |