2018-04-20 20:46:08 +09:00
|
|
|
version: 2
|
|
|
|
|
|
|
|
aliases:
|
|
|
|
- &defaults
|
|
|
|
docker:
|
2020-01-10 13:34:25 +09:00
|
|
|
- image: circleci/ruby:2.7-buster-node
|
2018-04-20 20:46:08 +09:00
|
|
|
environment: &ruby_environment
|
|
|
|
BUNDLE_APP_CONFIG: ./.bundle/
|
|
|
|
DB_HOST: localhost
|
|
|
|
DB_USER: root
|
2018-04-22 04:36:22 +09:00
|
|
|
RAILS_ENV: test
|
|
|
|
PARALLEL_TEST_PROCESSORS: 4
|
2018-04-20 20:46:08 +09:00
|
|
|
ALLOW_NOPAM: true
|
2018-05-11 18:51:07 +09:00
|
|
|
CONTINUOUS_INTEGRATION: true
|
2018-05-09 23:59:58 +09:00
|
|
|
DISABLE_SIMPLECOV: true
|
2018-10-25 08:17:01 +09:00
|
|
|
PAM_ENABLED: true
|
|
|
|
PAM_DEFAULT_SERVICE: pam_test
|
2018-10-21 00:28:04 +09:00
|
|
|
PAM_CONTROLLED_SERVICE: pam_test_controlled
|
2018-04-20 20:46:08 +09:00
|
|
|
working_directory: ~/projects/mastodon/
|
|
|
|
|
|
|
|
- &attach_workspace
|
|
|
|
attach_workspace:
|
|
|
|
at: ~/projects/
|
|
|
|
|
|
|
|
- &persist_to_workspace
|
|
|
|
persist_to_workspace:
|
|
|
|
root: ~/projects/
|
|
|
|
paths:
|
|
|
|
- ./mastodon/
|
|
|
|
|
2018-04-23 16:16:26 +09: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 18:20:30 +09:00
|
|
|
- v2-ruby-dependencies-
|
2018-04-23 16:16:26 +09:00
|
|
|
|
2018-04-20 20:46:08 +09: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
|
2019-12-30 01:00:43 +09:00
|
|
|
|
|
|
|
## TODO: FIX THESE BUSTER DEPENDANCES
|
|
|
|
sudo wget http://ftp.au.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u3_amd64.deb
|
|
|
|
sudo dpkg -i libicu57_57.1-6+deb9u3_amd64.deb
|
|
|
|
sudo wget http://ftp.au.debian.org/debian/pool/main/p/protobuf/libprotobuf10_3.0.0-9_amd64.deb
|
|
|
|
sudo dpkg -i libprotobuf10_3.0.0-9_amd64.deb
|
2018-04-20 20:46:08 +09:00
|
|
|
|
|
|
|
- &install_ruby_dependencies
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
|
|
|
- *install_system_dependencies
|
|
|
|
- run: ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
|
2018-04-23 16:16:26 +09:00
|
|
|
- *restore_ruby_dependencies
|
2018-08-18 11:05:42 +09:00
|
|
|
- run: bundle install --clean --jobs 16 --path ./vendor/bundle/ --retry 3 --with pam_authentication --without development production && bundle clean
|
2018-04-20 20:46:08 +09:00
|
|
|
- save_cache:
|
2018-04-23 16:16:26 +09:00
|
|
|
key: v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
|
2018-04-20 20:46:08 +09:00
|
|
|
paths:
|
2018-04-23 16:16:26 +09:00
|
|
|
- ./.bundle/
|
2018-04-20 20:46:08 +09:00
|
|
|
- ./vendor/bundle/
|
2018-08-18 11:05:42 +09:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: ~/projects/
|
|
|
|
paths:
|
|
|
|
- ./mastodon/.bundle/
|
|
|
|
- ./mastodon/vendor/bundle/
|
2018-04-20 20:46:08 +09: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 17:55:50 +09:00
|
|
|
command: ./bin/retry bundle exec parallel_test ./spec/ --group-by filesize --type rspec
|
2018-04-20 20:46:08 +09:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
install:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *install_steps
|
|
|
|
|
2020-01-10 13:34:25 +09:00
|
|
|
install-ruby2.7:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *install_ruby_dependencies
|
|
|
|
|
2018-12-29 15:23:07 +09:00
|
|
|
install-ruby2.6:
|
2018-04-20 20:46:08 +09:00
|
|
|
<<: *defaults
|
2020-01-10 13:34:25 +09:00
|
|
|
docker:
|
|
|
|
- image: circleci/ruby:2.6-buster-node
|
|
|
|
environment: *ruby_environment
|
2018-04-20 20:46:08 +09:00
|
|
|
<<: *install_ruby_dependencies
|
|
|
|
|
2018-12-29 15:23:07 +09:00
|
|
|
install-ruby2.5:
|
2018-04-20 20:46:08 +09:00
|
|
|
<<: *defaults
|
|
|
|
docker:
|
2019-12-30 01:00:43 +09:00
|
|
|
- image: circleci/ruby:2.5-buster-node
|
2018-04-20 20:46:08 +09:00
|
|
|
environment: *ruby_environment
|
|
|
|
<<: *install_ruby_dependencies
|
|
|
|
|
2018-12-29 15:23:07 +09:00
|
|
|
install-ruby2.4:
|
2018-07-04 02:47:09 +09:00
|
|
|
<<: *defaults
|
|
|
|
docker:
|
2019-12-30 01:00:43 +09:00
|
|
|
- image: circleci/ruby:2.4-buster-node
|
2018-07-04 02:47:09 +09:00
|
|
|
environment: *ruby_environment
|
|
|
|
<<: *install_ruby_dependencies
|
|
|
|
|
2018-04-23 16:16:26 +09:00
|
|
|
build:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
|
|
|
- *install_system_dependencies
|
|
|
|
- run: ./bin/rails assets:precompile
|
2018-07-31 05:22:55 +09:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: ~/projects/
|
2018-04-23 16:16:26 +09:00
|
|
|
paths:
|
2018-07-31 05:22:55 +09:00
|
|
|
- ./mastodon/public/assets
|
|
|
|
- ./mastodon/public/packs-test/
|
2018-04-23 16:16:26 +09:00
|
|
|
|
2020-01-11 10:04:57 +09:00
|
|
|
test-migrations:
|
|
|
|
<<: *defaults
|
|
|
|
docker:
|
|
|
|
- image: circleci/ruby:2.7-buster-node
|
|
|
|
environment: *ruby_environment
|
|
|
|
- image: circleci/postgres:10.6-alpine
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: root
|
|
|
|
- image: circleci/redis:5-alpine
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
|
|
|
- *install_system_dependencies
|
|
|
|
- run:
|
|
|
|
name: Create database
|
|
|
|
command: ./bin/rails parallel:create
|
|
|
|
- run:
|
|
|
|
name: Run migrations
|
|
|
|
command: ./bin/rails parallel:migrate
|
|
|
|
|
2020-01-10 13:34:25 +09:00
|
|
|
test-ruby2.7:
|
|
|
|
<<: *defaults
|
|
|
|
docker:
|
|
|
|
- image: circleci/ruby:2.7-buster-node
|
|
|
|
environment: *ruby_environment
|
|
|
|
- image: circleci/postgres:10.6-alpine
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: root
|
|
|
|
- image: circleci/redis:5-alpine
|
|
|
|
<<: *test_steps
|
|
|
|
|
2018-12-29 15:23:07 +09:00
|
|
|
test-ruby2.6:
|
2018-04-20 20:46:08 +09:00
|
|
|
<<: *defaults
|
|
|
|
docker:
|
2019-12-30 01:00:43 +09:00
|
|
|
- image: circleci/ruby:2.6-buster-node
|
2018-04-20 20:46:08 +09:00
|
|
|
environment: *ruby_environment
|
2018-12-29 15:23:07 +09:00
|
|
|
- image: circleci/postgres:10.6-alpine
|
2018-04-20 20:46:08 +09:00
|
|
|
environment:
|
|
|
|
POSTGRES_USER: root
|
2019-08-30 23:59:11 +09:00
|
|
|
- image: circleci/redis:5-alpine
|
2018-04-20 20:46:08 +09:00
|
|
|
<<: *test_steps
|
|
|
|
|
2018-12-29 15:23:07 +09:00
|
|
|
test-ruby2.5:
|
2018-04-20 20:46:08 +09:00
|
|
|
<<: *defaults
|
|
|
|
docker:
|
2019-12-30 01:00:43 +09:00
|
|
|
- image: circleci/ruby:2.5-buster-node
|
2018-04-20 20:46:08 +09:00
|
|
|
environment: *ruby_environment
|
2018-12-29 15:23:07 +09:00
|
|
|
- image: circleci/postgres:10.6-alpine
|
2018-04-20 20:46:08 +09:00
|
|
|
environment:
|
|
|
|
POSTGRES_USER: root
|
2019-08-30 23:59:11 +09:00
|
|
|
- image: circleci/redis:5-alpine
|
2018-04-20 20:46:08 +09:00
|
|
|
<<: *test_steps
|
|
|
|
|
2018-12-29 15:23:07 +09:00
|
|
|
test-ruby2.4:
|
2018-07-04 02:47:09 +09:00
|
|
|
<<: *defaults
|
|
|
|
docker:
|
2019-12-30 01:00:43 +09:00
|
|
|
- image: circleci/ruby:2.4-buster-node
|
2018-07-04 02:47:09 +09:00
|
|
|
environment: *ruby_environment
|
2018-12-29 15:23:07 +09:00
|
|
|
- image: circleci/postgres:10.6-alpine
|
2018-07-04 02:47:09 +09:00
|
|
|
environment:
|
|
|
|
POSTGRES_USER: root
|
2019-08-30 23:59:11 +09:00
|
|
|
- image: circleci/redis:5-alpine
|
2018-07-04 02:47:09 +09:00
|
|
|
<<: *test_steps
|
|
|
|
|
2018-04-20 20:46:08 +09:00
|
|
|
test-webui:
|
|
|
|
<<: *defaults
|
|
|
|
docker:
|
2019-12-30 01:00:43 +09:00
|
|
|
- image: circleci/node:12-buster
|
2018-04-20 20:46:08 +09:00
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
2018-05-06 17:55:50 +09:00
|
|
|
- run: ./bin/retry yarn test:jest
|
2018-04-20 20:46:08 +09:00
|
|
|
|
|
|
|
check-i18n:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
2019-09-12 11:58:33 +09:00
|
|
|
- *install_system_dependencies
|
2018-04-20 20:46:08 +09:00
|
|
|
- run: bundle exec i18n-tasks check-normalized
|
2019-06-17 02:12:12 +09:00
|
|
|
- run: bundle exec i18n-tasks unused -l en
|
2018-10-25 08:17:01 +09:00
|
|
|
- run: bundle exec i18n-tasks check-consistent-interpolations
|
2019-09-12 11:58:33 +09:00
|
|
|
- run: bundle exec rake repo:check_locales_files
|
2018-04-20 20:46:08 +09:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build-and-test:
|
|
|
|
jobs:
|
|
|
|
- install
|
2020-01-10 13:34:25 +09:00
|
|
|
- install-ruby2.7:
|
|
|
|
requires:
|
|
|
|
- install
|
2018-12-29 15:23:07 +09:00
|
|
|
- install-ruby2.6:
|
2018-04-20 20:46:08 +09:00
|
|
|
requires:
|
|
|
|
- install
|
2020-01-10 13:34:25 +09:00
|
|
|
- install-ruby2.7
|
2018-12-29 15:23:07 +09:00
|
|
|
- install-ruby2.5:
|
2018-04-23 16:16:26 +09:00
|
|
|
requires:
|
|
|
|
- install
|
2020-01-10 13:34:25 +09:00
|
|
|
- install-ruby2.7
|
2018-12-29 15:23:07 +09:00
|
|
|
- install-ruby2.4:
|
2018-07-04 02:47:09 +09:00
|
|
|
requires:
|
|
|
|
- install
|
2020-01-10 13:34:25 +09:00
|
|
|
- install-ruby2.7
|
2018-04-23 16:16:26 +09:00
|
|
|
- build:
|
2018-04-20 20:46:08 +09:00
|
|
|
requires:
|
2020-01-10 13:34:25 +09:00
|
|
|
- install-ruby2.7
|
2020-01-11 10:04:57 +09:00
|
|
|
- test-migrations:
|
|
|
|
requires:
|
|
|
|
- install-ruby2.7
|
2020-01-10 13:34:25 +09:00
|
|
|
- test-ruby2.7:
|
|
|
|
requires:
|
|
|
|
- install-ruby2.7
|
|
|
|
- build
|
2018-12-29 15:23:07 +09:00
|
|
|
- test-ruby2.6:
|
|
|
|
requires:
|
|
|
|
- install-ruby2.6
|
|
|
|
- build
|
2018-04-20 20:46:08 +09:00
|
|
|
- test-ruby2.5:
|
|
|
|
requires:
|
|
|
|
- install-ruby2.5
|
2018-04-23 16:16:26 +09:00
|
|
|
- build
|
2018-04-20 20:46:08 +09:00
|
|
|
- test-ruby2.4:
|
|
|
|
requires:
|
|
|
|
- install-ruby2.4
|
2018-04-23 16:16:26 +09:00
|
|
|
- build
|
2018-04-20 20:46:08 +09:00
|
|
|
- test-webui:
|
|
|
|
requires:
|
|
|
|
- install
|
|
|
|
- check-i18n:
|
|
|
|
requires:
|
2020-01-10 13:34:25 +09:00
|
|
|
- install-ruby2.7
|