Skip to content

F2: Feed model scopes and helpers #807

F2: Feed model scopes and helpers

F2: Feed model scopes and helpers #807

Workflow file for this run

name: ci
on:
push:
branches:
- master
- f2
pull_request:
branches:
- master
- f2
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle config set without 'test'
bundle install --jobs 4 --retry 3
- name: Run RuboCop
run: bundle exec rubocop --parallel
reek:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle config set without 'test'
bundle install --jobs 4 --retry 3
- name: Run Reek
run: bundle exec reek --single-line .
brakeman:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle config set without 'test'
bundle install --jobs 4 --retry 3
- name: Run Brakeman
run: bundle exec brakeman --except "${{ vars.FEEDER_BRAKEMAN_EXCEPTIONS }}" .
bundle-audit:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle config set without 'test'
bundle install --jobs 4 --retry 3
- name: Run Bundle Audit
run: bundle exec bundle audit
yaml-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile*') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle config set without 'test'
bundle install --jobs 4 --retry 3
- name: Run yaml-lint
run: bundle exec yaml-lint ./**/*.yml ./.github/**/*.yml
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:10
ports:
- 5432:5432
env:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: "feeder_test"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Install PostgreSQL client
run: |
sudo apt-get --yes install libpq-dev
- name: Run tests
env:
RAILS_MASTER_KEY: "${{ secrets.FEEDER_RAILS_MASTER_KEY_TEST }}"
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/feeder_test"
REDIS_URL: "redis://localhost:6379/0"
RAILS_ENV: test
HONEYBADGER_API_KEY: "${{ secrets.FEEDER_HONEYBADGER_API_KEY }}"
FREEFEED_TOKEN: "TEST_TOKEN"
FREEFEED_BASE_URL: "https://candy.freefeed.net"
run: |
bundle exec rails db:reset
bundle exec rspec