Addressing https://github.com/OpenHistoricalMap/issues/issues/1180 by… #71
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: OHM Tests | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - 1180-hundreds-of-ohm-website-test-failures | |
| # pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Ruby ${{ matrix.ruby }} | |
| strategy: | |
| matrix: | |
| ruby: ['3.2'] | |
| fail-fast: false | |
| runs-on: ubuntu-latest | |
| env: | |
| RAILS_ENV: test | |
| OPENSTREETMAP_MEMCACHE_SERVERS: 127.0.0.1 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - name: Setup ruby | |
| uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| rubygems: 3.4.10 | |
| bundler-cache: true | |
| - name: Cache node modules | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| cache: yarn | |
| - name: Install packages | |
| run: | | |
| sudo apt-get -yqq update | |
| sudo apt-get -yqq install memcached libvips-dev | |
| - name: Install node modules | |
| run: bundle exec bin/yarn install | |
| - name: Create database | |
| run: | | |
| sudo systemctl start postgresql | |
| sudo -u postgres createuser -s $(id -un) | |
| createdb openstreetmap | |
| - name: Configure rails | |
| run: | | |
| cp config/github.database.yml config/database.yml | |
| cp config/example.storage.yml config/storage.yml | |
| touch config/settings.local.yml | |
| - name: Populate database | |
| run: | | |
| sed -f script/normalise-structure db/structure.sql > db/structure.expected | |
| rm -f db/structure.sql | |
| 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 i18n export | |
| - name: Compile assets | |
| run: bundle exec rails assets:precompile | |
| timeout-minutes: 10 | |
| - name: Create tmp/pids directory | |
| run: mkdir -p tmp/pids | |
| - name: Run ruby on rails tests | |
| run: bundle exec rails test:all | |
| continue-on-error: true | |
| - name: Run javascript tests | |
| run: bundle exec teaspoon | |
| - name: Upload screenshots | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| if: failure() | |
| with: | |
| name: screenshots | |
| path: tmp/screenshots | |
| if-no-files-found: ignore | |
| - name: Report completion to Coveralls | |
| uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7 | |
| with: | |
| github-token: ${{ secrets.github_token }} | |
| flag-name: ruby-${{ matrix.ruby }} | |
| format: lcov | |
| parallel: true | |
| finish: | |
| name: Finalise | |
| needs: test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 1 | |
| steps: | |
| - name: Report completion to Coveralls | |
| uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7 | |
| with: | |
| github-token: ${{ secrets.github_token }} | |
| parallel-finished: true |