6 group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
7 cancel-in-progress: true
10 name: Ubuntu ${{ matrix.ubuntu }}, Ruby ${{ matrix.ruby }}
13 ubuntu: [20.04, 22.04]
15 runs-on: ubuntu-${{ matrix.ubuntu }}
18 OPENSTREETMAP_MEMCACHE_SERVERS: 127.0.0.1
20 - name: Checkout source
21 uses: actions/checkout@v3
23 uses: ruby/setup-ruby@v1
25 ruby-version: ${{ matrix.ruby }}
27 - name: Cache node modules
28 uses: actions/cache@v3
31 key: yarn-ubuntu-${{ matrix.ubuntu }}-${{ hashFiles('yarn.lock') }}
33 yarn-ubuntu-${{ matrix.ubuntu }}-
34 - name: Install packages
36 sudo apt-get -yqq update
37 sudo apt-get -yqq install memcached libvips-dev
38 - name: Create database
40 sudo systemctl start postgresql
41 sudo -u postgres createuser -s $(id -un)
42 createdb openstreetmap
43 - name: Configure rails
45 cp config/github.database.yml config/database.yml
46 cp config/example.storage.yml config/storage.yml
47 touch config/settings.local.yml
48 - name: Populate database
50 sed -f script/normalise-structure db/structure.sql > db/structure.expected
51 bundle exec rails db:migrate
52 sed -f script/normalise-structure db/structure.sql > db/structure.actual
53 diff -uw db/structure.expected db/structure.actual
54 - name: Export javascript strings
55 run: bundle exec rails i18n:js:export
56 - name: Install node modules
57 run: bundle exec bin/yarn install
58 - name: Compile assets
59 run: bundle exec rails assets:precompile
61 run: bundle exec rails test:all
62 - name: Report completion to Coveralls
63 uses: coverallsapp/github-action@v2.1.2
65 github-token: ${{ secrets.github_token }}
66 flag-name: ubuntu-${{ matrix.ubuntu }}-ruby-${{ matrix.ruby }}
72 runs-on: ubuntu-latest
74 - name: Report completion to Coveralls
75 uses: coverallsapp/github-action@v2.1.2
77 github-token: ${{ secrets.github_token }}
78 parallel-finished: true