Commit c9dbd5f5 authored by Mike Greiling's avatar Mike Greiling

optimize gitlab ci to only run npm install once

parent 8425e647
...@@ -24,7 +24,6 @@ before_script: ...@@ -24,7 +24,6 @@ before_script:
- '[ "$USE_BUNDLE_INSTALL" != "true" ] || retry bundle install --without postgres production --jobs $(nproc) $FLAGS' - '[ "$USE_BUNDLE_INSTALL" != "true" ] || retry bundle install --without postgres production --jobs $(nproc) $FLAGS'
- retry gem install knapsack - retry gem install knapsack
- '[ "$SETUP_DB" != "true" ] || bundle exec rake db:drop db:create db:schema:load db:migrate add_limits_mysql' - '[ "$SETUP_DB" != "true" ] || bundle exec rake db:drop db:create db:schema:load db:migrate add_limits_mysql'
- npm install
stages: stages:
- prepare - prepare
...@@ -109,12 +108,14 @@ setup-test-env: ...@@ -109,12 +108,14 @@ setup-test-env:
<<: *dedicated-runner <<: *dedicated-runner
stage: prepare stage: prepare
script: script:
- npm install
- bundle exec rake webpack:compile - bundle exec rake webpack:compile
- bundle exec rake assets:precompile 2>/dev/null - bundle exec rake assets:precompile 2>/dev/null
- bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init' - bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init'
artifacts: artifacts:
expire_in: 7d expire_in: 7d
paths: paths:
- node_modules
- public/assets - public/assets
- tmp/tests - tmp/tests
...@@ -235,7 +236,7 @@ spinach 9 10 ruby21: *spinach-knapsack-ruby21 ...@@ -235,7 +236,7 @@ spinach 9 10 ruby21: *spinach-knapsack-ruby21
script: script:
- bundle exec $CI_BUILD_NAME - bundle exec $CI_BUILD_NAME
rubocop: rubocop:
<<: *ruby-static-analysis <<: *ruby-static-analysis
<<: *dedicated-runner <<: *dedicated-runner
stage: test stage: test
...@@ -298,7 +299,7 @@ karma: ...@@ -298,7 +299,7 @@ karma:
cache: cache:
paths: paths:
- vendor/ruby - vendor/ruby
- node_modules/ - node_modules
stage: test stage: test
<<: *use-db <<: *use-db
<<: *dedicated-runner <<: *dedicated-runner
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment