]> git.openstreetmap.org Git - rails.git/blob - .github/workflows/docker.yml
Update workflows to run on Ubuntu 22.04
[rails.git] / .github / workflows / docker.yml
1 name: Docker
2 on:
3   - push
4   - pull_request
5 concurrency:
6   group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
7   cancel-in-progress: true
8 jobs:
9   test:
10     name: Docker
11     runs-on: ubuntu-22.04
12     steps:
13     - name: Checkout source
14       uses: actions/checkout@v3
15     - name: Poke config
16       run: |
17         cp config/example.storage.yml config/storage.yml
18         cp config/docker.database.yml config/database.yml
19         touch config/settings.local.yml
20     - name: Build Docker Image
21       run: |
22         docker-compose build
23     - name: Start Docker-Compose
24       run: |
25         docker-compose up -d
26         sleep 15 # let the DB warm up a little
27     - name: Prepare Database
28       run: |
29         docker-compose run --rm web bundle exec rails db:migrate
30         docker-compose run --rm web bundle exec rails i18n:js:export
31         docker-compose run --rm web bundle exec rails assets:precompile
32         docker-compose run --rm web osmosis --rx docker/null-island.osm.xml --wd host=db database=openstreetmap user=openstreetmap password=openstreetmap validateSchemaVersion=no
33     - name: Test Basic Website
34       run: |
35         curl -siL http://127.0.0.1:3000 | egrep '^HTTP/1.1 200 OK'
36         curl -siL http://127.0.0.1:3000 | grep 'OpenStreetMap is the free wiki world map'
37         curl -siL http://127.0.0.1:3000/api/0.6/node/1 | grep 'Null Island'
38     - name: Test Complete Suite
39       run: |
40         docker-compose run --rm web bundle exec rails db:test:prepare
41         docker-compose run --rm web bundle exec rails test:all