name: Test on: push: branches: [ $default-branch ] pull_request_target: branches: [ $default-branch ] pull_request: env: BUNDLE_GEMFILE: 'gemfiles/rails70_gems.rb' FERRUM_PROCESS_TIMEOUT: '15' WD_CACHE_TIME: '864000' # 10 days jobs: lint: name: Lint runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.0' bundler-cache: true - name: Run Standard Ruby linter run: bin/standardrb --no-fix --fail-fast test: name: Functional Testing runs-on: ubuntu-20.04 # In order to install libvips 8.9+ version steps: - name: Checkout code uses: actions/checkout@v2 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.0' 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@v2 with: path: test/fixtures/app/doc/screenshots/ - name: Upload Coverage uses: actions/upload-artifact@v2 with: name: coverage path: coverage matrix: name: Test Integration needs: [ 'test', 'lint' ] runs-on: ubuntu-20.04 strategy: matrix: ruby-version: [ '3.1', '3.0', '2.7', '2.6', 'jruby' ] gemfile: - 'rails61_gems.rb' - 'rails60_gems.rb' - 'rails52.gemfile' include: - ruby-version: 2.7 gemfile: rails70_gems.rb # NOTE: We are testing rails 7 + ruby 3 in the `test` job # - ruby-version: 3.0 # gemfile: rails70_gems.rb env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }} steps: - name: Checkout code uses: actions/checkout@v2 - 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 needs: [ 'test', 'lint' ] runs-on: ubuntu-20.04 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@v2 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.0' 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 }}