Merge branch 'dev' #1640
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pagy CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: ['**'] | |
pull_request: | |
branches: ['**'] | |
jobs: | |
ruby_check: | |
name: Ruby Check | |
continue-on-error: true | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5.3.1 | |
with: | |
concurrent_skipping: 'never' | |
skip_after_successful_duplicate: 'true' | |
paths: '["gem/lib/**", "gem/locales/en.yml", ".simplecov", ".rubocop", "Rakefile", "test/**", "tasks/**"]' | |
paths_ignore: '["**/*.md"]' | |
do_not_skip: '["workflow_dispatch", "schedule"]' | |
ruby_test: | |
needs: ruby_check | |
if: ${{ needs.ruby_check.outputs.should_skip != 'true' }} | |
name: Ruby ${{ matrix.ruby-version }} Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby-version: ['3.1', '3.2', '3.3'] | |
fail-fast: false | |
env: | |
# Gemfile versions not locked, so tests may fail, forcing us to update the code | |
BUNDLE_GEMFILE: .github/gemfiles/default | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Check Rubocop compliance | |
run: bundle exec rubocop --format github | |
- name: Check Tests | |
run: bundle exec rake test | |
- name: Check Coverage # fails unless 100% | |
run: bundle exec rake check_coverage | |
e2e_check: | |
name: E2E Check | |
continue-on-error: true | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5.3.1 | |
with: | |
concurrent_skipping: 'never' | |
skip_after_successful_duplicate: 'true' | |
paths: '["gem/lib/**", "gem/locales/en.yml", "gem/javascripts/**", "e2e/**"]' | |
paths_ignore: '["**/*.md"]' | |
do_not_skip: '["workflow_dispatch", "schedule"]' | |
e2e_test: | |
needs: e2e_check | |
if: ${{ needs.e2e_check.outputs.should_skip != 'true' }} | |
name: E2E Test | |
runs-on: ubuntu-latest | |
env: | |
# absolute path required to run sinatra for cypress in e2e working dir | |
BUNDLE_GEMFILE: /home/runner/work/pagy/pagy/.github/gemfiles/default | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3' | |
bundler-cache: true | |
- name: Install Cypress and Test Dependencies | |
working-directory: ./e2e | |
run: npm i | |
- name: Run Cypress Tests | |
uses: cypress-io/github-action@v6.6.0 | |
with: | |
config: baseUrl=http://0.0.0.0:4567,video=false | |
start: bundle exec rackup -D -o 0.0.0.0 -p 4567 pagy_app.ru | |
install: false | |
wait-on: http://0.0.0.0:4567 | |
working-directory: e2e |