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