semaphore: # Default `.semaphore/semaphore.yml` contents version: v1.0 name: AppSignal Ruby Build and Tests agent: machine: type: e1-standard-2 os_image: ubuntu1804 # Cancel all running and queued workflows before this one auto_cancel: running: # Ignore main AND develop branch as we want it to build all workflows when: "branch != 'main' AND branch != 'develop'" global_job_config: env_vars: - name: RUNNING_IN_CI value: "true" - name: _BUNDLER_CACHE value: "v2" - name: _GEMS_CACHE value: "v2" prologue: commands: - checkout - rm -f $HOME/.rbenv/plugins/rbenv-gem-rehash/etc/rbenv.d/exec/~gem-rehash.bash - | if [ -n "$_C_VERSION" ]; then sem-version c $_C_VERSION else echo Skipping C-lang install fi - | if [ -n "$RUBY_VERSION" ]; then if ! (sem-version ruby "$RUBY_VERSION"); then ruby_key="rbenv-ruby-$RUBY_VERSION" echo "Attempting to build Ruby $RUBY_VERSION from source" git -C "$HOME/.rbenv/plugins/ruby-build" pull cache restore "$ruby_key" sem-version ruby "$RUBY_VERSION" if ! cache has_key "$ruby_key"; then cache store "$ruby_key" "$HOME/.rbenv/versions/$RUBY_VERSION" fi fi ./support/check_versions else echo Skipping Ruby install fi blocks: - name: Validation dependencies: [] task: prologue: commands: - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) - ./support/bundler_wrapper install --jobs=3 --retry=3 jobs: - name: Validate CI setup env_vars: - name: RUBY_VERSION value: 3.2.2 - name: GEMSET value: no_dependencies - name: BUNDLE_GEMFILE value: Gemfile commands: - ./support/bundler_wrapper exec rake build_matrix:semaphore:validate epilogue: on_pass: commands: - cache store $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) .bundle - cache store $_GEMS_CACHE-gems-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) $HOME/.gem - name: Ruby linters dependencies: [] task: prologue: commands: - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) - ./support/bundler_wrapper install --jobs=3 --retry=3 jobs: - name: RuboCop env_vars: - name: RUBY_VERSION value: 3.2.2 - name: GEMSET value: no_dependencies - name: BUNDLE_GEMFILE value: Gemfile commands: - ./support/bundler_wrapper exec rubocop epilogue: on_pass: commands: - cache store $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) .bundle - cache store $_GEMS_CACHE-gems-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) $HOME/.gem - name: Other linters dependencies: [] task: jobs: - name: Git Lint (Lintje) commands: - script/lint_git - name: Integration tests dependencies: - Validation task: prologue: commands: - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-diagnose-$(checksum Gemfile) - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-diagnose-$(checksum Gemfile) - ./support/bundler_wrapper install --jobs=3 --retry=3 - ./support/bundler_wrapper exec rake extension:install - git submodule init - git submodule update jobs: - name: Diagnose env_vars: - name: RUBY_VERSION value: 3.0.2 - name: LANGUAGE value: ruby commands: - spec/integration/diagnose/bin/test epilogue: on_pass: commands: - cache store $_BUNDLER_CACHE-bundler-$RUBY_VERSION-diagnose-$(checksum Gemfile) .bundle - cache store $_GEMS_CACHE-gems-$RUBY_VERSION-diagnose-$(checksum Gemfile) $HOME/.gem matrix: env_vars: # Shared for all jobs in the build matrix - name: BUNDLE_PATH value: "../.bundle/" - name: RAILS_ENV value: "test" - name: JRUBY_OPTS value: "" - name: COV value: "1" prologue: # Shared for all jobs in the build matrix commands: - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) - ./support/install_deps - bundle config set clean 'true' - ./support/bundler_wrapper install --jobs=3 --retry=3 epilogue: # Shared for all jobs in the build matrix on_pass: commands: - cache store $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) .bundle - cache store $_GEMS_CACHE-gems-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) $HOME/.gem on_fail: commands: - "[ -e ext/install.report ] && cat ext/install.report || echo 'No ext/install.report file found'" - "[ -f ext/mkmf.log ] && cat ext/mkmf.log || echo 'No ext/mkmf.log file found'" defaults: rubygems: "latest" bundler: "latest" gemsets: # By default all gems are tested none: - "no_dependencies" minimal: - "no_dependencies" - "rails-6.0" - "rails-6.1" - "rails-7.0" ruby: - ruby: "3.0.5" - ruby: "3.1.3" - ruby: "3.2.1" - ruby: "jruby-9.4.0.0" gems: "minimal" gems: - gem: "no_dependencies" - gem: "capistrano2" - gem: "capistrano3" - gem: "grape" - gem: "hanami" only: ruby: - "3.0.5" - "3.1.3" - "3.2.1" - gem: "http5" - gem: "padrino" - gem: "psych-3" only: ruby: - "3.0.5" - "3.1.3" - "3.2.1" - gem: "psych-4" only: ruby: - "3.0.5" - "3.1.3" - "3.2.1" - gem: "que" - gem: "que_beta" - gem: "rails-6.0" only: ruby: - "3.0.5" - "jruby-9.4.0.0" - gem: "rails-6.1" only: ruby: - "3.0.5" - "3.1.3" - "3.2.1" - "jruby-9.4.0.0" - gem: "rails-7.0" only: ruby: - "3.0.5" - "3.1.3" - "3.2.1" - "jruby-9.4.0.0" - gem: "sequel" - gem: "sinatra" - gem: "webmachine1" - gem: "webmachine2"