Install Node packages before compiling assets in Gitlab CI

The asset compilation was failing because it needs the packages that are
installed with `npm clean-install`.

We're now installing the Node packages after installing the gems, like
we do in Github Actions. For this, we need to install the `npm` package.
This commit is contained in:
Javi Martín
2024-04-02 19:04:24 +02:00
parent b520cb8f24
commit 0902fde19d

View File

@@ -17,13 +17,13 @@ tests:
TEST_COVERAGE: 1 TEST_COVERAGE: 1
parallel: 5 parallel: 5
script: script:
- apt-get update && apt-get install -y nodejs chromium - apt-get update && apt-get install -y nodejs npm chromium
- for i in config/*.example; do cp "$i" "${i/.example}"; done - for i in config/*.example; do cp "$i" "${i/.example}"; done
- for i in config/*.gitlab; do cp "$i" "${i/.gitlab}"; done - for i in config/*.gitlab; do cp "$i" "${i/.gitlab}"; done
- bundle --without development - bundle --without development
- npm clean-install
- bundle exec rake db:setup - bundle exec rake db:setup
- bundle exec rake assets:precompile > /dev/null 2>&1 - bundle exec rake assets:precompile > /dev/null 2>&1
- npm clean-install
- bin/knapsack_pro_rspec - bin/knapsack_pro_rspec
artifacts: artifacts:
when: on_failure when: on_failure