2018-04-20 12:46:08 +01:00
|
|
|
version: 2
|
|
|
|
|
|
|
|
aliases:
|
|
|
|
- &defaults
|
|
|
|
docker:
|
|
|
|
- image: circleci/ruby:2.5.1-stretch-node
|
|
|
|
environment: &ruby_environment
|
|
|
|
BUNDLE_APP_CONFIG: ./.bundle/
|
|
|
|
DB_HOST: localhost
|
|
|
|
DB_USER: root
|
2018-04-21 20:36:22 +01:00
|
|
|
RAILS_ENV: test
|
|
|
|
PARALLEL_TEST_PROCESSORS: 4
|
2018-04-20 12:46:08 +01:00
|
|
|
ALLOW_NOPAM: true
|
2018-05-11 10:51:07 +01:00
|
|
|
CONTINUOUS_INTEGRATION: true
|
2018-05-09 15:59:58 +01:00
|
|
|
DISABLE_SIMPLECOV: true
|
2018-04-20 12:46:08 +01:00
|
|
|
working_directory: ~/projects/mastodon/
|
|
|
|
|
|
|
|
- &attach_workspace
|
|
|
|
attach_workspace:
|
|
|
|
at: ~/projects/
|
|
|
|
|
|
|
|
- &persist_to_workspace
|
|
|
|
persist_to_workspace:
|
|
|
|
root: ~/projects/
|
|
|
|
paths:
|
|
|
|
- ./mastodon/
|
|
|
|
|
2018-04-23 08:16:26 +01:00
|
|
|
- &restore_ruby_dependencies
|
|
|
|
restore_cache:
|
|
|
|
keys:
|
|
|
|
- v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
|
|
|
|
- v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-
|
2018-04-28 10:20:30 +01:00
|
|
|
- v2-ruby-dependencies-
|
2018-04-23 08:16:26 +01:00
|
|
|
|
2018-04-20 12:46:08 +01:00
|
|
|
- &install_steps
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- *attach_workspace
|
|
|
|
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-node-dependencies-{{ checksum "yarn.lock" }}
|
|
|
|
- v1-node-dependencies-
|
|
|
|
- run: yarn install --frozen-lockfile
|
|
|
|
- save_cache:
|
|
|
|
key: v1-node-dependencies-{{ checksum "yarn.lock" }}
|
|
|
|
paths:
|
|
|
|
- ./node_modules/
|
|
|
|
|
|
|
|
- *persist_to_workspace
|
|
|
|
|
|
|
|
- &install_system_dependencies
|
|
|
|
run:
|
|
|
|
name: Install system dependencies
|
|
|
|
command: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y libicu-dev libidn11-dev libprotobuf-dev protobuf-compiler
|
|
|
|
|
|
|
|
- &install_ruby_dependencies
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
|
|
|
|
|
|
|
- *install_system_dependencies
|
|
|
|
|
|
|
|
- run: ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
|
2018-04-23 08:16:26 +01:00
|
|
|
- *restore_ruby_dependencies
|
2018-08-18 03:05:42 +01:00
|
|
|
- run: bundle install --clean --jobs 16 --path ./vendor/bundle/ --retry 3 --with pam_authentication --without development production && bundle clean
|
2018-04-20 12:46:08 +01:00
|
|
|
- save_cache:
|
2018-04-23 08:16:26 +01:00
|
|
|
key: v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
|
2018-04-20 12:46:08 +01:00
|
|
|
paths:
|
2018-04-23 08:16:26 +01:00
|
|
|
- ./.bundle/
|
2018-04-20 12:46:08 +01:00
|
|
|
- ./vendor/bundle/
|
2018-08-18 03:05:42 +01:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: ~/projects/
|
|
|
|
paths:
|
|
|
|
- ./mastodon/.bundle/
|
|
|
|
- ./mastodon/vendor/bundle/
|
2018-04-20 12:46:08 +01:00
|
|
|
|
|
|
|
- &test_steps
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
|
|
|
|
|
|
|
- *install_system_dependencies
|
|
|
|
- run: sudo apt-get install -y ffmpeg
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Prepare Tests
|
|
|
|
command: ./bin/rails parallel:create parallel:load_schema parallel:prepare
|
|
|
|
- run:
|
|
|
|
name: Run Tests
|
2018-05-06 09:55:50 +01:00
|
|
|
command: ./bin/retry bundle exec parallel_test ./spec/ --group-by filesize --type rspec
|
2018-04-20 12:46:08 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
install:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *install_steps
|
|
|
|
|
|
|
|
install-ruby2.5:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *install_ruby_dependencies
|
|
|
|
|
|
|
|
install-ruby2.4:
|
|
|
|
<<: *defaults
|
|
|
|
docker:
|
|
|
|
- image: circleci/ruby:2.4.4-stretch-node
|
|
|
|
environment: *ruby_environment
|
|
|
|
<<: *install_ruby_dependencies
|
|
|
|
|
2018-07-03 18:47:09 +01:00
|
|
|
install-ruby2.3:
|
|
|
|
<<: *defaults
|
|
|
|
docker:
|
|
|
|
- image: circleci/ruby:2.3.7-stretch-node
|
|
|
|
environment: *ruby_environment
|
|
|
|
<<: *install_ruby_dependencies
|
|
|
|
|
2018-04-23 08:16:26 +01:00
|
|
|
build:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
|
|
|
- *install_system_dependencies
|
|
|
|
- run: ./bin/rails assets:precompile
|
2018-07-30 21:22:55 +01:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: ~/projects/
|
2018-04-23 08:16:26 +01:00
|
|
|
paths:
|
2018-07-30 21:22:55 +01:00
|
|
|
- ./mastodon/public/assets
|
|
|
|
- ./mastodon/public/packs-test/
|
2018-04-23 08:16:26 +01:00
|
|
|
|
2018-04-20 12:46:08 +01:00
|
|
|
test-ruby2.5:
|
|
|
|
<<: *defaults
|
|
|
|
docker:
|
|
|
|
- image: circleci/ruby:2.5.1-stretch-node
|
|
|
|
environment: *ruby_environment
|
|
|
|
- image: circleci/postgres:10.3-alpine
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: root
|
|
|
|
- image: circleci/redis:4.0.9-alpine
|
|
|
|
<<: *test_steps
|
|
|
|
|
|
|
|
test-ruby2.4:
|
|
|
|
<<: *defaults
|
|
|
|
docker:
|
|
|
|
- image: circleci/ruby:2.4.4-stretch-node
|
|
|
|
environment: *ruby_environment
|
|
|
|
- image: circleci/postgres:10.3-alpine
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: root
|
|
|
|
- image: circleci/redis:4.0.9-alpine
|
|
|
|
<<: *test_steps
|
|
|
|
|
2018-07-03 18:47:09 +01:00
|
|
|
test-ruby2.3:
|
|
|
|
<<: *defaults
|
|
|
|
docker:
|
|
|
|
- image: circleci/ruby:2.3.7-stretch-node
|
|
|
|
environment: *ruby_environment
|
|
|
|
- image: circleci/postgres:10.3-alpine
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: root
|
|
|
|
- image: circleci/redis:4.0.9-alpine
|
|
|
|
<<: *test_steps
|
|
|
|
|
2018-04-20 12:46:08 +01:00
|
|
|
test-webui:
|
|
|
|
<<: *defaults
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:8.11.1-stretch
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
2018-05-06 09:55:50 +01:00
|
|
|
- run: ./bin/retry yarn test:jest
|
2018-04-20 12:46:08 +01:00
|
|
|
|
|
|
|
check-i18n:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
|
|
|
- run: bundle exec i18n-tasks check-normalized
|
|
|
|
- run: bundle exec i18n-tasks unused
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build-and-test:
|
|
|
|
jobs:
|
|
|
|
- install
|
|
|
|
- install-ruby2.5:
|
|
|
|
requires:
|
|
|
|
- install
|
|
|
|
- install-ruby2.4:
|
2018-04-23 08:16:26 +01:00
|
|
|
requires:
|
|
|
|
- install
|
2018-08-18 03:05:42 +01:00
|
|
|
- install-ruby2.5
|
2018-07-03 18:47:09 +01:00
|
|
|
- install-ruby2.3:
|
|
|
|
requires:
|
|
|
|
- install
|
2018-08-18 03:05:42 +01:00
|
|
|
- install-ruby2.5
|
2018-04-23 08:16:26 +01:00
|
|
|
- build:
|
2018-04-20 12:46:08 +01:00
|
|
|
requires:
|
|
|
|
- install-ruby2.5
|
|
|
|
- test-ruby2.5:
|
|
|
|
requires:
|
|
|
|
- install-ruby2.5
|
2018-04-23 08:16:26 +01:00
|
|
|
- build
|
2018-04-20 12:46:08 +01:00
|
|
|
- test-ruby2.4:
|
|
|
|
requires:
|
|
|
|
- install-ruby2.4
|
2018-04-23 08:16:26 +01:00
|
|
|
- build
|
2018-07-03 18:47:09 +01:00
|
|
|
- test-ruby2.3:
|
|
|
|
requires:
|
|
|
|
- install-ruby2.3
|
|
|
|
- build
|
2018-04-20 12:46:08 +01:00
|
|
|
- test-webui:
|
|
|
|
requires:
|
|
|
|
- install
|
|
|
|
- check-i18n:
|
|
|
|
requires:
|
|
|
|
- install-ruby2.5
|