Skip to content

Fix issue when encountering reblog of deleted post in feed rebuild (#… #352

Fix issue when encountering reblog of deleted post in feed rebuild (#…

Fix issue when encountering reblog of deleted post in feed rebuild (#… #352

Workflow file for this run

name: test
on: [push]
env:
CI: "true"
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: groonga/pgroonga:latest-debian-11
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:6.0
ports:
- 6379:6379
options: --health-cmd "redis-cli -h localhost ping" --health-interval 10s --health-timeout 5s --health-retries 15
container:
image: ruby:3.0.3-bullseye
env:
DB_HOST: postgres
DB_USER: postgres
REDIS_HOST: redis
LOCAL_HTTPS: true
RAILS_ENV: test
PARALLEL_TEST_PROCESSORS: 4
ALLOW_NOPAM: true
CONTINUOUS_INTEGRATION: true
DISABLE_SIMPLECOV: true
steps:
- uses: actions/checkout@v1
- name: Install system dependencies
run: |
apt update
apt install apt-transport-https
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt update
apt install -y yarn ffmpeg libicu-dev libidn11-dev libprotobuf-dev protobuf-compiler nodejs
- name: Cache ruby dependencies
uses: actions/cache@v1
with:
path: vendor/bundle
key: v1-ruby-dependencies-${{ hashFiles('.ruby-version') }}-${{ hashFiles('Gemfile.lock') }}
restore-keys: |
v1-ruby-dependencies-${{ hashFiles('.ruby-version') }}-${{ hashFiles('Gemfile.lock') }}
v1-ruby-dependencies-${{ hashFiles('.ruby-version') }}-
v1-ruby-dependencies-
- name: Cache node dependencies
uses: actions/cache@v1
with:
path: node_modules
key: v1-node-dependencies-${{ hashFiles('.nvmrc') }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
v1-node-dependencies-${{ hashFiles('.nvmrc') }}-${{ hashFiles('yarn.lock') }}
v1-node-dependencies-${{ hashFiles('.nvmrc') }}-
v1-node-dependencies-
- name: bundle install
run: bundle install --clean --jobs 4 --path ./vendor/bundle/ --retry 3 --with pam_authentication --without production && bundle clean
- name: yarn install
run: yarn install --frozen-lockfile
# - name: Run rubocop
# run: bundle exec rubocop --fail-level W --display-only-fail-level-offenses --parallel
# - name: Run eslint
# run: yarn test:lint
- name: Run jest
run: yarn test:jest
# - name: Run brakeman
# run: bundle exec brakeman --exit-on-error
- name: Run rails assets:precompile
run: ./bin/rails assets:precompile
- name: Create database
run: ./bin/rails db:create
- name: Run migrations
run: ./bin/rails db:migrate
# When the test is run on github actions,
# paperclip uploads a file with 0 bytes and the test fails.
# To avoid this, change TMPDIR to a directory on the same partition.
# - name: Create tmp dir
# run: mkdir -p tmp_for_ci && echo "TMPDIR=$(pwd)/tmp_for_ci" >> $GITHUB_ENV
# - name: Run rspec
# run: bundle exec parallel_test ./spec/ --group-by filesize --type rspec