8 group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
9 cancel-in-progress: true
12 name: Ruby ${{ matrix.ruby }}
15 ruby: ['3.2', '3.3', '3.4']
17 runs-on: ubuntu-latest
20 OPENSTREETMAP_MEMCACHE_SERVERS: 127.0.0.1
23 - name: Checkout source
24 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26 uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0
28 ruby-version: ${{ matrix.ruby }}
31 - name: Cache node modules
32 uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
35 - name: Install packages
37 sudo apt-get -yqq update
38 sudo apt-get -yqq install memcached libvips-dev xvfb mesa-utils libgl1-mesa-dri
39 - name: Create database
41 sudo systemctl start postgresql
42 sudo -u postgres createuser -s $(id -un)
43 createdb openstreetmap
44 - name: Configure rails
46 cp config/github.database.yml config/database.yml
47 cp config/example.storage.yml config/storage.yml
48 touch config/settings.local.yml
49 - name: Install node modules
50 run: bundle exec bin/yarn install
51 - name: Populate database
53 sed -f script/normalise-structure db/structure.sql > db/structure.expected
54 rm -f db/structure.sql
55 bundle exec rails db:migrate
56 sed -f script/normalise-structure db/structure.sql > db/structure.actual
57 diff -uw db/structure.expected db/structure.actual
58 - name: Export javascript strings
59 run: bundle exec i18n export
60 - name: Compile assets
61 run: bundle exec rails assets:precompile
63 - name: Create tmp/pids directory
64 run: mkdir -p tmp/pids
65 - name: Enable virtual display
66 run: Xvfb :99 -screen 0 1024x768x24 &
68 run: bundle exec rails test:all
71 - name: Run javascript tests
72 run: bundle exec teaspoon
75 - name: Upload screenshots
76 uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
81 if-no-files-found: ignore
82 - name: Report completion to Coveralls
83 uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
85 github-token: ${{ secrets.github_token }}
86 flag-name: ruby-${{ matrix.ruby }}
92 runs-on: ubuntu-latest
95 - name: Report completion to Coveralls
96 uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
98 github-token: ${{ secrets.github_token }}
99 parallel-finished: true