123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- version: 2
- aliases:
- - &defaults
- docker:
- - image: circleci/ruby:2.6.0-stretch-node
- environment: &ruby_environment
- BUNDLE_APP_CONFIG: ./.bundle/
- DB_HOST: localhost
- DB_USER: root
- RAILS_ENV: test
- PARALLEL_TEST_PROCESSORS: 4
- ALLOW_NOPAM: true
- CONTINUOUS_INTEGRATION: true
- DISABLE_SIMPLECOV: true
- PAM_ENABLED: true
- PAM_DEFAULT_SERVICE: pam_test
- PAM_CONTROLLED_SERVICE: pam_test_controlled
- working_directory: ~/projects/mastodon/
- - &attach_workspace
- attach_workspace:
- at: ~/projects/
- - &persist_to_workspace
- persist_to_workspace:
- root: ~/projects/
- paths:
- - ./mastodon/
- - &restore_ruby_dependencies
- restore_cache:
- keys:
- - v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
- - v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-
- - v2-ruby-dependencies-
- - &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
- - *restore_ruby_dependencies
- - run: bundle install --clean --jobs 16 --path ./vendor/bundle/ --retry 3 --with pam_authentication --without development production && bundle clean
- - save_cache:
- key: v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
- paths:
- - ./.bundle/
- - ./vendor/bundle/
- - persist_to_workspace:
- root: ~/projects/
- paths:
- - ./mastodon/.bundle/
- - ./mastodon/vendor/bundle/
- - &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
- command: ./bin/retry bundle exec parallel_test ./spec/ --group-by filesize --type rspec
- jobs:
- install:
- <<: *defaults
- <<: *install_steps
- install-ruby2.6:
- <<: *defaults
- <<: *install_ruby_dependencies
- install-ruby2.5:
- <<: *defaults
- docker:
- - image: circleci/ruby:2.5.3-stretch-node
- environment: *ruby_environment
- <<: *install_ruby_dependencies
- install-ruby2.4:
- <<: *defaults
- docker:
- - image: circleci/ruby:2.4.5-stretch-node
- environment: *ruby_environment
- <<: *install_ruby_dependencies
- build:
- <<: *defaults
- steps:
- - *attach_workspace
- - *install_system_dependencies
- - run: ./bin/rails assets:precompile
- - persist_to_workspace:
- root: ~/projects/
- paths:
- - ./mastodon/public/assets
- - ./mastodon/public/packs-test/
- test-ruby2.6:
- <<: *defaults
- docker:
- - image: circleci/ruby:2.6.0-stretch-node
- environment: *ruby_environment
- - image: circleci/postgres:10.6-alpine
- environment:
- POSTGRES_USER: root
- - image: circleci/redis:5.0.3-alpine3.8
- <<: *test_steps
- test-ruby2.5:
- <<: *defaults
- docker:
- - image: circleci/ruby:2.5.3-stretch-node
- environment: *ruby_environment
- - image: circleci/postgres:10.6-alpine
- environment:
- POSTGRES_USER: root
- - image: circleci/redis:4.0.12-alpine
- <<: *test_steps
- test-ruby2.4:
- <<: *defaults
- docker:
- - image: circleci/ruby:2.4.5-stretch-node
- environment: *ruby_environment
- - image: circleci/postgres:10.6-alpine
- environment:
- POSTGRES_USER: root
- - image: circleci/redis:4.0.12-alpine
- <<: *test_steps
- test-webui:
- <<: *defaults
- docker:
- - image: circleci/node:8.15.0-stretch
- steps:
- - *attach_workspace
- - run: ./bin/retry yarn test:jest
- check-i18n:
- <<: *defaults
- steps:
- - *attach_workspace
- - run: bundle exec i18n-tasks check-normalized
- - run: bundle exec i18n-tasks unused
- - run: bundle exec i18n-tasks missing -t plural
- - run: bundle exec i18n-tasks check-consistent-interpolations
- workflows:
- version: 2
- build-and-test:
- jobs:
- - install
- - install-ruby2.6:
- requires:
- - install
- - install-ruby2.5:
- requires:
- - install
- - install-ruby2.6
- - install-ruby2.4:
- requires:
- - install
- - install-ruby2.6
- - build:
- requires:
- - install-ruby2.6
- - test-ruby2.6:
- requires:
- - install-ruby2.6
- - build
- - test-ruby2.5:
- requires:
- - install-ruby2.5
- - build
- - test-ruby2.4:
- requires:
- - install-ruby2.4
- - build
- - test-webui:
- requires:
- - install
- - check-i18n:
- requires:
- - install-ruby2.6
|