name: Test on: push: branches: [ master ] pull_request: paths: - '**.rb' - '**.gemfile' - '!bin/**' env: BUNDLE_GEMFILE: 'gemfiles/rails70_gems.rb' FERRUM_PROCESS_TIMEOUT: '15' WD_CACHE_TIME: '864000' # 10 days concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: test: name: Functional Testing runs-on: ubuntu-22.04 # In order to install libvips 8.9+ version timeout-minutes: 5 steps: - name: Checkout code uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.1' bundler-cache: true - name: Install libvips run: sudo apt install libvips libvips-dev libvips-tools - name: Run Tests with coverage run: bundle exec rake test env: COVERAGE: enabled - name: Upload Screenshots if: always() uses: actions/upload-artifact@v3 with: name: screenshots retention-days: 1 path: | test/fixtures/app/doc/screenshots/ tmp/capybara/screenshots-diffs/ - name: Upload Coverage uses: actions/upload-artifact@v3 with: name: coverage retention-days: 1 path: coverage matrix: name: Test Integration Rails & Ruby needs: [ 'test' ] runs-on: ubuntu-20.04 timeout-minutes: 5 strategy: matrix: ruby-version: [ '3.1', '3.0', '2.7', 'jruby' ] gemfile: - 'rails70_gems.rb' - 'rails61_gems.rb' - 'rails60_gems.rb' exclude: - ruby-version: 'jruby' gemfile: 'rails70_gems.rb' env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }} steps: - name: Checkout code uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true - name: Install libvips run: sudo apt install libvips libvips-dev libvips-tools - name: Run tests run: bundle exec rake test matrix_screenshot_driver: name: Test Integration Capybara & Image Drivers needs: [ 'test' ] runs-on: ubuntu-20.04 timeout-minutes: 5 strategy: matrix: screenshot-driver: [ 'vips', 'chunky_png' ] capybara-driver: [ 'selenium_headless', 'selenium_chrome_headless' ] include: - screenshot-driver: 'chunky_png' capybara-driver: 'cuprite' steps: - name: Checkout code uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.1' bundler-cache: true - name: Install libvips run: sudo apt install libvips libvips-dev libvips-tools - name: Run tests run: bundle exec rake test:integration env: SCREENSHOT_DRIVER: ${{ matrix.screenshot-driver }} CAPYBARA_DRIVER: ${{ matrix.capybara-driver }} - name: Upload Screenshots uses: actions/upload-artifact@v3 if: failure() with: name: screenshots-${{ matrix.screenshot-driver }}-${{ matrix.capybara-driver }} retention-days: 1 path: | test/fixtures/app/doc/screenshots/ tmp/capybara/screenshots-diffs/