Sha256: 37e1fb8ce6e4f06440fc00f65b7b61bbf2a3e967d78d31a25378ba9cbd48d82b

Contents?: true

Size: 1.69 KB

Versions: 1

Compression:

Stored size: 1.69 KB

Contents

---
name: ruby-tests

on:
  pull_request_target:
  push:
    branches:
      - main
  workflow_dispatch:
    inputs: {}

env:
  PGUSER: postgres
  PGHOST: localhost

jobs:
  build:
    name: Tests with Ruby ${{ matrix.ruby }} and ${{ matrix.gemfile }}
    runs-on: "ubuntu-latest"
    if: |
      github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target' ||
      github.actor != 'dependabot[bot]'
    strategy:
      fail-fast: false
      matrix:
        ruby: ["3.1", "3.2", "3.3"]
        gemfile:
          - Gemfile
    services:
      postgres:
        image: postgres
        ports: ["5432:5432"]
        env:
          POSTGRES_HOST: localhost
          POSTGRES_PORT: 5432
          POSTGRES_HOST_AUTH_METHOD: trust
        options:
          --health-cmd pg_isready --health-interval 10s --health-timeout 5s
          --health-retries 5

    steps:
      - uses: actions/checkout@v4

      - uses: actions/cache@v4
        with:
          path: vendor/bundle
          key: >
            ${{ runner.os }}-${{ matrix.ruby }}-gems-${{
            hashFiles(matrix.gemfile) }}

      - name: Install PostgreSQL client
        run: |
          sudo apt -y install libpq-dev

      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}

      - name: Install gem dependencies
        env:
          BUNDLE_GEMFILE: ${{ matrix.gemfile }}
        run: |
          gem install bundler
          bundle config path vendor/bundle
          bundle update --jobs 4 --retry 3

      - name: Run Tests
        env:
          BUNDLE_GEMFILE: ${{ matrix.gemfile }}
        run: |
          psql -U postgres -c "create database test"
          bundle exec rake

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
email_data-1733617827.0.0 .github/workflows/ruby-tests.yml