-
Notifications
You must be signed in to change notification settings - Fork 412
157 lines (140 loc) Β· 5.22 KB
/
pagy-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Pagy CI
on:
push:
branches:
- '**'
pull_request:
branches: ['**']
jobs:
should_run:
name: Run or skip?
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@master
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: 'never'
skip_after_successful_duplicate: 'true'
paths_ignore: '["**/*.md", "**/docs/**", "lib/config/pagy.rb", "LICENSE.txt"]'
do_not_skip: '["workflow_dispatch", "schedule"]'
ruby_test:
needs: should_run
if: ${{ needs.should_run.outputs.should_skip != 'true' }}
name: Ruby ${{ matrix.ruby-version }} Test
runs-on: ubuntu-latest
strategy:
matrix:
include:
- ruby-version: '3.0'
env:
BUNDLE_GEMFILE: .github/gemfiles/default
- ruby-version: '3.1'
env:
BUNDLE_GEMFILE: .github/gemfiles/default
# RUBYOPT: '--disable-error_highlight'
- ruby-version: '3.2'
env:
BUNDLE_GEMFILE: .github/gemfiles/default
CODECOV: true
CHECK_MANIFEST: true
# RUBYOPT: '--disable-error_highlight'
fail-fast: false
env: ${{ matrix.env }}
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: Run Ruby Tests
run: bundle exec rake test
- name: Run Rubocop
run: bundle exec rubocop --format github
- name: Run Codecov
if: ${{ env.CODECOV == 'true' }}
uses: codecov/codecov-action@v3.1.4
with:
fail_ci_if_error: true
- name: Check gem manifest
if: ${{ env.CHECK_MANIFEST == 'true' }}
run: bundle exec rake manifest:check
e2e_test:
needs: should_run
if: ${{ needs.should_run.outputs.should_skip != 'true' }}
name: E2E Test
runs-on: ubuntu-latest
env:
# absolute path 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.2'
bundler-cache: true
- name: Install Cypress and Test Dependencies
working-directory: ./e2e
run: npm i
- name: Run Cypress Tests
# You may pin to the exact commit or the version.
# uses: cypress-io/github-action@c5724eda82337bcff977ce14509f47052c12e04c
uses: cypress-io/github-action@v6.1.0
with:
# Sends test results to Cypress Dashboard
record: # optional
# Set configuration values. Separate multiple values with a comma. The values set here override any values set in your configuration file.
config: baseUrl=http://0.0.0.0:4567,video=false
# Path to the cypress config file where configuration values are set.
config-file: # optional, default is
# Sets Cypress environment variables
env: # optional
# Name of the browser to use
browser: # optional
# Command that overrides cypress run
command: # optional
# Command for starting local server in the background
start: bundle exec rackup -D -o 0.0.0.0 -p 4567 pagy_app.ru
# A different start command on Windows
start-windows: # optional
# Command to run in build step before starting tests
build: # optional
# Whether or not to run install
install: false
# Custom install command to use
install-command: # optional
# Whether or not to run tests
runTests: # optional
# Local server URL to wait for
wait-on: http://0.0.0.0:4567
# Amount of time to wait for wait-on url to be available
wait-on-timeout: # optional
# Whether or not to load balance tests using multiple containers
parallel: # optional
# Group setting for tests
group: # optional
# Tag setting for tests
tag: # optional
# Working directory containing Cypress folder
working-directory: e2e
# Whether or not to use headed mode
headed: # optional
# Provide a specific specs to run
spec: # optional
# Path of project to run
project: # optional
# You can prefix the default test command using the command-prefix option.
command-prefix: # optional
# ID associates multiple CI machines to one test run
ci-build-id: # optional
# Custom cache key
cache-key: # optional
# Whether or not to silence any Cypress specific output from stdout
quiet: # optional
# Lets the action know that Cypress is running component tests and not e2e tests
component: # optional