restore-keys: |
yarn-${{ env.os }}-
- name: Install node modules
- run: bundle exec rake yarn:install
+ run: bundle exec rails yarn:install
- name: Create dummy database configuration
run: cp config/example.database.yml config/database.yml
- name: Run eslint
- run: bundle exec rake eslint
+ run: bundle exec rails eslint
brakeman:
name: Brakeman
runs-on: ubuntu-20.04
- name: Populate database
run: |
sed -f script/normalise-structure db/structure.sql > db/structure.expected
- bundle exec rake db:migrate
+ bundle exec rails db:migrate
sed -f script/normalise-structure db/structure.sql > db/structure.actual
diff -uw db/structure.expected db/structure.actual
- name: Export javascript strings
- run: bundle exec rake i18n:js:export
+ run: bundle exec rails i18n:js:export
- name: Install node modules
- run: bundle exec rake yarn:install
+ run: bundle exec rails yarn:install
- name: Run tests
run: bundle exec rails test:all
- name: Report completion to Coveralls
* The OSM database schema is changed periodically and you need to keep up with these improvements. Go to your `openstreetmap-website` directory and run:
```
-bundle exec rake db:migrate
+bundle exec rails db:migrate
```
## Testing on the osm dev server
* It's not recommended to use `rails server` in production. Our recommended approach is to use [Phusion Passenger](https://www.phusionpassenger.com/). Instructions are available for [setting it up with most web servers](https://www.phusionpassenger.com/documentation_and_support#documentation).
* Passenger will, by design, use the Production environment and therefore the production database - make sure it contains the appropriate data and user accounts.
* The included version of the map call is quite slow and eats a lot of memory. You should consider using [CGIMap](https://github.com/zerebubuth/openstreetmap-cgimap) instead.
-* Make sure you generate the i18n files and precompile the production assets: `RAILS_ENV=production rake i18n:js:export assets:precompile`
+* Make sure you generate the i18n files and precompile the production assets: `RAILS_ENV=production rails i18n:js:export assets:precompile`
* Make sure the web server user as well as the rails user can read, write and create directories in `tmp/`.
```
bundle exec rubocop
-bundle exec rake eslint
+bundle exec rails eslint
bundle exec erblint .
```
Run the Rails database migrations:
- docker-compose run --rm web bundle exec rake db:migrate
+ docker-compose run --rm web bundle exec rails db:migrate
### Tests
&& bundle install
# Install NodeJS packages using yarnpkg
-# `bundle exec rake yarn:install` will not work
+# `bundle exec rails yarn:install` will not work
ADD package.json yarn.lock /app/
RUN yarnpkg --ignore-engines install
We use [Yarn](https://yarnpkg.com/) to manage the Node.js modules required for the project.
```
-bundle exec rake yarn:install
+bundle exec rails yarn:install
```
## Prepare local settings file
To create the three databases - for development, testing and production - run:
```
-bundle exec rake db:create
+bundle exec rails db:create
```
### Database structure
To create all the tables, indexes and constraints, run:
```
-bundle exec rake db:migrate
+bundle exec rails db:migrate
```
## Running the tests