Skip to content

Commit 91fa54f

Browse files
authored
Split CI into the core app, and then feature specs (#4022)
* Split feature tests off to own area * Split up feature specs * Split up feature specs * Split up feature specs * Split up pipeline * Split up pipeline * Split up pipeline * Split up pipeline * Split further * Improve stability slightly * Skip tagged flaky * Split mroe
1 parent 6d224bd commit 91fa54f

14 files changed

+1251
-26
lines changed

Diff for: .github/workflows/ci-features-admin.yml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI Features - Admin
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
rspec:
7+
runs-on: ubuntu-latest
8+
services:
9+
db:
10+
image: postgres
11+
env:
12+
##
13+
# The Postgres service fails its docker health check unless you
14+
# specify these environment variables
15+
#
16+
POSTGRES_USER: postgres
17+
POSTGRES_PASSWORD: postgres
18+
POSTGRES_DB: growstuff_test
19+
ports: ['5432:5432']
20+
options: >-
21+
--health-cmd pg_isready
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
25+
env:
26+
APP_DOMAIN_NAME: localhost:3000
27+
APP_PROTOCOL: http
28+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
29+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/growstuff_test
30+
DEVISE_SECRET_KEY: secret
31+
ELASTIC_SEARCH_VERSION: "7.5.1-amd64"
32+
GROWSTUFF_EMAIL: "[email protected]"
33+
GROWSTUFF_FLICKR_KEY: secretkey"
34+
GROWSTUFF_FLICKR_SECRET: secretsecret
35+
GROWSTUFF_SITE_NAME: "Growstuff (travis)"
36+
RAILS_ENV: test
37+
RAILS_SECRET_TOKEN: supersecret
38+
39+
steps:
40+
- name: Checkout this repo
41+
uses: actions/checkout@v4
42+
43+
- name: Configure sysctl limits
44+
run: |
45+
sudo swapoff -a
46+
sudo sysctl -w vm.swappiness=1
47+
sudo sysctl -w fs.file-max=262144
48+
sudo sysctl -w vm.max_map_count=262144
49+
50+
- name: Start Elasticsearch
51+
uses: elastic/elastic-github-actions/elasticsearch@master
52+
with:
53+
stack-version: 7.5.1
54+
55+
##
56+
# Cache Yarn modules
57+
#
58+
# See https://github.com/actions/cache/blob/master/examples.md#node---yarn for details
59+
#
60+
- name: Get yarn cache directory path
61+
id: yarn-cache-dir-path
62+
run: echo "::set-output name=dir::$(yarn cache dir)"
63+
- name: Setup yarn cache
64+
uses: actions/cache@v4
65+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
66+
with:
67+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
68+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
69+
restore-keys: |
70+
${{ runner.os }}-yarn-
71+
72+
- name: Install required OS packages
73+
run: |
74+
sudo apt-get -y install libpq-dev google-chrome-stable
75+
76+
- name: Install NodeJS
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version: '12'
80+
81+
- name: Install Ruby (version given by .ruby-version) and Bundler
82+
uses: ruby/setup-ruby@v1
83+
with:
84+
bundler-cache: true
85+
86+
- name: Install required JS packages
87+
run: yarn install
88+
89+
- name: install chrome
90+
run: sudo apt-get install google-chrome-stable
91+
92+
- name: Prepare database for testing
93+
run: bundle exec rails db:prepare
94+
95+
- name: precompile assets
96+
run: bundle exec rails assets:precompile
97+
98+
- name: index into elastic search
99+
run: bundle exec rails search:reindex
100+
101+
- name: Run rspec (admin/)
102+
run: bundle exec rspec spec/features/admin/ -fd -t ~@flaky

Diff for: .github/workflows/ci-features-comments.yml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI Features - Comments
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
rspec:
7+
runs-on: ubuntu-latest
8+
services:
9+
db:
10+
image: postgres
11+
env:
12+
##
13+
# The Postgres service fails its docker health check unless you
14+
# specify these environment variables
15+
#
16+
POSTGRES_USER: postgres
17+
POSTGRES_PASSWORD: postgres
18+
POSTGRES_DB: growstuff_test
19+
ports: ['5432:5432']
20+
options: >-
21+
--health-cmd pg_isready
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
25+
env:
26+
APP_DOMAIN_NAME: localhost:3000
27+
APP_PROTOCOL: http
28+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
29+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/growstuff_test
30+
DEVISE_SECRET_KEY: secret
31+
ELASTIC_SEARCH_VERSION: "7.5.1-amd64"
32+
GROWSTUFF_EMAIL: "[email protected]"
33+
GROWSTUFF_FLICKR_KEY: secretkey"
34+
GROWSTUFF_FLICKR_SECRET: secretsecret
35+
GROWSTUFF_SITE_NAME: "Growstuff (travis)"
36+
RAILS_ENV: test
37+
RAILS_SECRET_TOKEN: supersecret
38+
39+
steps:
40+
- name: Checkout this repo
41+
uses: actions/checkout@v4
42+
43+
- name: Configure sysctl limits
44+
run: |
45+
sudo swapoff -a
46+
sudo sysctl -w vm.swappiness=1
47+
sudo sysctl -w fs.file-max=262144
48+
sudo sysctl -w vm.max_map_count=262144
49+
50+
- name: Start Elasticsearch
51+
uses: elastic/elastic-github-actions/elasticsearch@master
52+
with:
53+
stack-version: 7.5.1
54+
55+
##
56+
# Cache Yarn modules
57+
#
58+
# See https://github.com/actions/cache/blob/master/examples.md#node---yarn for details
59+
#
60+
- name: Get yarn cache directory path
61+
id: yarn-cache-dir-path
62+
run: echo "::set-output name=dir::$(yarn cache dir)"
63+
- name: Setup yarn cache
64+
uses: actions/cache@v4
65+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
66+
with:
67+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
68+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
69+
restore-keys: |
70+
${{ runner.os }}-yarn-
71+
72+
- name: Install required OS packages
73+
run: |
74+
sudo apt-get -y install libpq-dev google-chrome-stable
75+
76+
- name: Install NodeJS
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version: '12'
80+
81+
- name: Install Ruby (version given by .ruby-version) and Bundler
82+
uses: ruby/setup-ruby@v1
83+
with:
84+
bundler-cache: true
85+
86+
- name: Install required JS packages
87+
run: yarn install
88+
89+
- name: install chrome
90+
run: sudo apt-get install google-chrome-stable
91+
92+
- name: Prepare database for testing
93+
run: bundle exec rails db:prepare
94+
95+
- name: precompile assets
96+
run: bundle exec rails assets:precompile
97+
98+
- name: index into elastic search
99+
run: bundle exec rails search:reindex
100+
101+
- name: Run rspec (comments/)
102+
run: bundle exec rspec spec/features/comments/ -fd -t ~@flaky

Diff for: .github/workflows/ci-features-conversations.yml

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CI Features - Conversations
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
rspec:
7+
runs-on: ubuntu-latest
8+
services:
9+
db:
10+
image: postgres
11+
env:
12+
##
13+
# The Postgres service fails its docker health check unless you
14+
# specify these environment variables
15+
#
16+
POSTGRES_USER: postgres
17+
POSTGRES_PASSWORD: postgres
18+
POSTGRES_DB: growstuff_test
19+
ports: ['5432:5432']
20+
options: >-
21+
--health-cmd pg_isready
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
25+
env:
26+
APP_DOMAIN_NAME: localhost:3000
27+
APP_PROTOCOL: http
28+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
29+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/growstuff_test
30+
DEVISE_SECRET_KEY: secret
31+
ELASTIC_SEARCH_VERSION: "7.5.1-amd64"
32+
GROWSTUFF_EMAIL: "[email protected]"
33+
GROWSTUFF_FLICKR_KEY: secretkey"
34+
GROWSTUFF_FLICKR_SECRET: secretsecret
35+
GROWSTUFF_SITE_NAME: "Growstuff (travis)"
36+
RAILS_ENV: test
37+
RAILS_SECRET_TOKEN: supersecret
38+
39+
steps:
40+
- name: Checkout this repo
41+
uses: actions/checkout@v4
42+
43+
- name: Configure sysctl limits
44+
run: |
45+
sudo swapoff -a
46+
sudo sysctl -w vm.swappiness=1
47+
sudo sysctl -w fs.file-max=262144
48+
sudo sysctl -w vm.max_map_count=262144
49+
50+
- name: Start Elasticsearch
51+
uses: elastic/elastic-github-actions/elasticsearch@master
52+
with:
53+
stack-version: 7.5.1
54+
55+
##
56+
# Cache Yarn modules
57+
#
58+
# See https://github.com/actions/cache/blob/master/examples.md#node---yarn for details
59+
#
60+
- name: Get yarn cache directory path
61+
id: yarn-cache-dir-path
62+
run: echo "::set-output name=dir::$(yarn cache dir)"
63+
- name: Setup yarn cache
64+
uses: actions/cache@v4
65+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
66+
with:
67+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
68+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
69+
restore-keys: |
70+
${{ runner.os }}-yarn-
71+
72+
- name: Install required OS packages
73+
run: |
74+
sudo apt-get -y install libpq-dev google-chrome-stable
75+
76+
- name: Install NodeJS
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version: '12'
80+
81+
- name: Install Ruby (version given by .ruby-version) and Bundler
82+
uses: ruby/setup-ruby@v1
83+
with:
84+
bundler-cache: true
85+
86+
- name: Install required JS packages
87+
run: yarn install
88+
89+
- name: install chrome
90+
run: sudo apt-get install google-chrome-stable
91+
92+
- name: Prepare database for testing
93+
run: bundle exec rails db:prepare
94+
95+
- name: precompile assets
96+
run: bundle exec rails assets:precompile
97+
98+
- name: index into elastic search
99+
run: bundle exec rails search:reindex
100+
101+
- name: Run rspec (conversations/)
102+
run: bundle exec rspec spec/features/conversations/ -fd -t ~@flaky
103+

0 commit comments

Comments
 (0)