forked from thredded/thredded
-
Notifications
You must be signed in to change notification settings - Fork 2
164 lines (141 loc) · 4.37 KB
/
build.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
158
159
160
161
162
163
164
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: thredded_gem_test
POSTGRES_USER: thredded
POSTGRES_PASSWORD: thredded
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: thredded_gem_test
MYSQL_USER: thredded
MYSQL_PASSWORD: thredded
MYSQL_ROOT_PASSWORD: thredded
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 3
ports:
- "3306:3306"
strategy:
fail-fast: false
matrix:
ruby: ["2.7.8", "3.0.7", "3.1.6", "3.2.4", "3.3.4"]
node: ["14"]
rails_version: ["6.1", "7.0", "7.2", "edge"] # "rubocop", "i18n-tasks"
# db: [sqlite3, postgres, mysql]
db: [sqlite3, postgres]
exclude:
# Not supported versions
- ruby: 2.7.8
rails_version: 7.2
- ruby: 3.0.7
rails_version: 7.2
- ruby: 2.7.8
rails_version: edge
- ruby: 3.0.7
rails_version: edge
# Logger Issues
- ruby: 3.3.4
rails_version: edge
- ruby: 3.3.4
rails_version: 7.2
- ruby: 3.2.4
rails_version: edge
- ruby: 3.2.4
rails_version: 7.2
- ruby: 3.1.6
rails_version: edge
- ruby: 3.1.6
rails_version: 7.2
# Psych issues
- ruby: 3.3.4
rails_version: 6.1
- ruby: 3.2.4
rails_version: 6.1
- ruby: 3.1.6
rails_version: 6.1
# include:
# - ruby: 2.7
# rails: rubocop
# db: null
# - ruby: 2.7
# rails: i18n-tasks
# db: null
env:
RAILS_ENV: test
COVERAGE: 1
FERRUM_DEFAULT_TIMEOUT: 20
BUNDLE_GEMFILE: "spec/gemfiles/rails_${{ matrix.rails_version }}.gemfile"
DB_USERNAME: thredded
DB_PASSWORD: thredded
steps:
- uses: actions/checkout@v4
- name: Set DB adapter
run: |
export DB=${{ matrix.db }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # install gems and cache
- uses: browser-actions/setup-chrome@v1
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install Node Packages via Yarn
run: |
cd spec/dummy && yarn && cd -
- name: "Run Tests: test:nojs"
run: |
SIMPLECOV_NAME="test:nojs" bundle exec rspec --force-color --format d --tag=~js --tag=~i18n_tasks
- name: "Run Tests: test:js"
run: |
SIMPLECOV_NAME="test:js" bundle exec rspec --force-color --format d --tag=js
- name: "Run Tests: spec/migrations"
run: |
MIGRATION_SPEC=1 SIMPLECOV_NAME="test:migrations" bundle exec rspec spec/migration --force-color --format d
- name: "Run Tests: spec/configuration/run_all"
run: |
spec/configuration/run_all
- name: "Run Tests: run_spec_repeatedly"
run: |
bin/run_specs_repeatedly --tag=threaded_render
# - name: Test & publish code coverage
# uses: paambaati/[email protected]
# env:
# CC_TEST_REPORTER_ID: <code_climate_reporter_id>
# - name: Cache Onebox Data and Views
# uses: actions/cache@v2
# with:
# path: |
# tmp/cache/onebox-data
# tmp/cache/onebox-views
# spec/dummy/tmp/cache/onebox-data
# spec/dummy/tmp/cache/onebox-views
# key: onebox-${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.gemfile }}
# restore-keys: |
# onebox-${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.gemfile }}
# - name: Notify Slack
# uses: 8398a7/action-slack@v3
# if: always()
# with:
# status: ${{ job.status }}
# author_name: GitHub Actions
# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}