.github/workflows/ruby-tests.yml in email_data-1641689574.0.0 vs .github/workflows/ruby-tests.yml in email_data-1642294286.0.0

- old
+ new

@@ -1,68 +1,67 @@ --- name: ruby-tests on: - pull_request: - branches: - - main + pull_request_target: push: branches: - main + workflow_dispatch: + inputs: {} jobs: build: - name: Tests with Ruby ${{ matrix.ruby }} + 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.0.x", "2.7.x"] - + ruby: ["2.7", "3.0", "3.1"] + gemfile: + - Gemfile services: postgres: image: postgres:11.5 ports: ["5432:5432"] options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v2.3.5 + - uses: actions/checkout@v2.4.0 - - uses: actions/cache@v2.1.6 + - uses: actions/cache@v2.1.7 with: path: vendor/bundle key: > ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ - hashFiles('**/Gemfile.lock') }} - restore-keys: > - ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ - hashFiles('**/Gemfile.lock') }} + hashFiles(matrix.gemfile) }} + - name: Install PostgreSQL 11 client + run: | + sudo apt -y install libpq-dev + - name: Set up Ruby - uses: actions/setup-ruby@v1.1.3 + uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - name: Install PostgreSQL 11 client - run: | - sudo apt-get -yqq install libpq-dev - - name: Install gem dependencies env: - PGHOST: localhost - PGUSER: postgres - RAILS_ENV: test + BUNDLE_GEMFILE: ${{ matrix.gemfile }} run: | gem install bundler bundle config path vendor/bundle - bundle install --jobs 4 --retry 3 + bundle update --jobs 4 --retry 3 - name: Run Tests env: PGHOST: localhost PGUSER: postgres - RAILS_ENV: test + BUNDLE_GEMFILE: ${{ matrix.gemfile }} run: | psql -U postgres -c "create database test" bundle exec rake