Merge pull request #4905 from kleintom/dropzone_ctrl_v_paste_images #9939
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: build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - development | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+' | |
| - 'v[0-9]+.[0-9]+.[0-9]+-*' | |
| pull_request: | |
| branches: | |
| - master | |
| - development | |
| schedule: | |
| - cron: '0 0 * * *' | |
| jobs: | |
| build: | |
| if: | | |
| !( | |
| contains(github.event.head_commit.message, '[ci skip]') || | |
| contains(github.event.head_commit.message, '[ci-skip]') || | |
| contains(github.event.head_commit.message, '[skip ci]') || | |
| contains(github.event.head_commit.message, '[skip-ci]') | |
| ) | |
| env: | |
| PGHOST: 127.0.0.1 | |
| PGUSER: postgres | |
| RAILS_ENV: test | |
| CROSSREF_EMAIL: ${{ secrets.CROSSREF_EMAIL }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04] | |
| worker: [0, 1, 2, 3] | |
| services: | |
| db: | |
| image: postgis/postgis:17-3.5 | |
| ports: ['5432:5432'] | |
| env: | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Get startup date | |
| id: datetime | |
| run: | | |
| echo "iso_date=$(date --iso-8601 -u)" >> $GITHUB_OUTPUT | |
| echo "year_week=$(date -u +'%Y-%U')" >> $GITHUB_OUTPUT | |
| - name: Git checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| - name: Set up Ruby Bundler gems cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: vendor/bundle | |
| key: ${{ runner.os }}-${{ matrix.os }}-gems-${{ hashFiles('.ruby-version', '**/Gemfile', '**/Gemfile.lock') }} | |
| - name: Set up Node 24 LTS | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| - name: Set up Node packages cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.npm | |
| **/node_modules | |
| key: ${{ runner.os }}-${{ matrix.os }}-node-24-${{ hashFiles('**/package-lock.json') }} | |
| - name: Set up assets cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| tmp/cache/shakapacker | |
| public/assets | |
| public/packs-test | |
| key: ${{ runner.os }}-assets-${{ steps.datetime.outputs.iso_date }}-${{ hashFiles('app/javascript/**', 'app/assets/**') }} | |
| restore-keys: | | |
| ${{ runner.os }}-assets-${{ steps.datetime.outputs.iso_date }} | |
| - name: Set up VCR cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: spec/fixtures/vcr_cassettes | |
| key: ${{ runner.os }}-vcr-rev2-${{ steps.datetime.outputs.year_week }}-${{ hashFiles('**/Gemfile.lock') }}-${{ matrix.worker }} | |
| - name: Install apt packages | |
| run: | | |
| sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list | |
| sudo apt-get update | |
| sudo apt-get install -y tesseract-ocr libgeos-dev libproj-dev build-essential imagemagick libmagickwand-dev | |
| - name: Change ownership of /usr/src to runner user to allow cache to be restored | |
| run: sudo chown $(id -u) /usr/src | |
| - name: Set up TaxonWorks config files | |
| run: | | |
| cp config/application_settings.yml.ci config/application_settings.yml | |
| cp config/secrets.yml.example config/secrets.yml | |
| cp config/database.yml.ci config/database.yml | |
| - name: Install Ruby gems | |
| run: | | |
| gem install bundler | |
| bundle config path vendor/bundle | |
| bundle install --jobs 4 --retry 3 | |
| - name: Install Node packages | |
| run: | | |
| npm install | |
| - name: Set up database | |
| run: | | |
| bundle exec rails db:create | |
| bundle exec rails db:migrate | |
| - name: Precompile assets | |
| run: bundle exec rails assets:precompile | |
| - name: Run tests | |
| env: | |
| TEST_WORKER: ${{ matrix.worker }} | |
| TEST_WORKERS: 4 | |
| run: .github/spec_runner.sh |