name: ubuntu

on: [push]

jobs:
  test:
    strategy:
      matrix:
        ruby: [ head, 3.4, 3.3, 3.2 ]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v6
    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
    - name: Install dependencies
      run: |
        sudo apt install libncursesw5-dev
        gem install bundler --no-document
        bundle install
    - name: Build package
      run: bundle exec rake build
    - name: Install package
      run: |
        gem install pkg/curses-*.gem
        ruby -r curses -e 'puts Curses::VERSION'
