Skip to content

Merge pull request #385 from seuros/main #9

Merge pull request #385 from seuros/main

Merge pull request #385 from seuros/main #9

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
# This allows a subsequently queued workflow run to interrupt previous runs.
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
AllRubies:
if: ${{ always() }}
runs-on: ubuntu-latest
name: All Rubies Result
needs: [Test]
steps:
- run: '[[ "${{ needs.Test.result }}" == "success" ]]'
Test:
strategy:
fail-fast: false
matrix:
ruby:
- head
- "3.3"
- "3.2"
- "3.1"
- "jruby"
os:
- ubuntu
# Windows users, feel free to open a PR :)
# - windows
- macos
exclude:
- os: windows # See issue #242, windows support would be welcome.
runs-on: ${{ matrix.os }}-latest
continue-on-error: ${{ matrix.ruby == 'head' || matrix.os == 'windows' || matrix.os == 'macos' }}
name: Ruby ${{ matrix.ruby }} (${{ matrix.os }})
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install Geos (Linux)
if: matrix.os == 'ubuntu'
run: |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get install -yqq libgeos-dev
- name: Install Geos (Mac)
if: matrix.os == 'macos'
run: HOMEBREW_NO_INSTALL_CLEANUP=1 brew install geos
- name: Install Geos (Windows)
if: matrix.os == 'windows'
run: TODO
- name: Bundle Install
run: bundle install
- name: Set Maintainer Mode
if: ${{ github.event.pull_request }}
run: export MAINTAINER_MODE='-Wold-style-definition'
- name: Test
run: bundle exec rake
Memcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "head"
bundler-cache: true
- name: Install dependencies
run: |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get install -yqq libgeos-dev valgrind
- name: Test & Memcheck
run: bundle exec rake test:valgrind
RuboCop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "head"
bundler-cache: true
- run: |
bundle exec rubocop --color --parallel
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: |
# Information at https://apt.llvm.org/
sudo bash -c "$(wget -qO - https://apt.llvm.org/llvm.sh)" > /dev/null
latest_clang=$(dpkg --list | grep -E 'clang-[1-9]' | awk '{print $2}' | sort | tail -1 | cut -d- -f2)
echo "Install clang-format for LLVM $latest_clang"
sudo apt-get install -yqq clang-format-$latest_clang
# Ensure usage of latest LLVM whatever the default is in
# the 'ubuntu-latest' image.
sudo ln -sf $(which clang-format-$latest_clang) $(which clang-format)
- name: Show version
run: clang-format --version
- name: Run clang-format
run: bin/clang-format lint