name: ubuntu

on: [push]

jobs:
  test:
    strategy:
      matrix:
        ruby: [ head, 3.1, 2.7, 2.6 ]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - 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'
