name: ubuntu
concurrency:
  group: "${{github.workflow}}-${{github.ref}}"
  cancel-in-progress: true
on:
  workflow_dispatch:
  pull_request:
    types: [opened, synchronize]
    branches:
      - '*'
  push:
    branches:
      - master
    tags:
      - v*.*.*
  schedule:
    - cron: "0 8 * * 3" # At 08:00 on Wednesday # https://crontab.guru/#0_8_*_*_3

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        ruby:
          - "2.5"
          - "2.6"
          - "2.7"
          - "3.0"
          - "3.1"
          - "head"
          - "jruby-9.2.21.0"
          - "jruby-9.3.9.0"
          - "jruby-head"
          - "truffleruby-22.3.0"
          - "truffleruby-head"
    steps:
    - uses: actions/checkout@v3
    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{matrix.ruby}}
        bundler-cache: true
    - run: bundle exec rake compile test
