Skip to content

Fix intermittent category select flake in category_scopes_spec for is… #8885

Fix intermittent category select flake in category_scopes_spec for is…

Fix intermittent category select flake in category_scopes_spec for is… #8885

Workflow file for this run

name: CI
# Controls when the workflow will run
on: ['push', 'pull_request', 'workflow_dispatch']
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
SECRET_KEY_BASE: ci_secret_key_base_not_used_for_real_sessions
# Use native service containers instead of standalone actions
# to avoid Docker Hub rate limits and Docker client version mismatches.
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
mariadb:
image: mariadb:10.5
env:
MARIADB_DATABASE: dashboard_testing
MARIADB_USER: wiki
MARIADB_PASSWORD: wikiedu
MARIADB_ROOT_PASSWORD: wikiedu
ports:
- 3306:3306
options: >-
--health-cmd "healthcheck.sh --connect --innodb_initialized"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
# checks-out your repository under $GITHUB_WORKSPACE , so that workflow can access it.
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: install Pandoc
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '2.9.2.1'
- name: install ImageMagick
uses: mfinelli/setup-imagemagick@v6
with:
cache: true
# Cache ImageMagick binaries
- name: Cache Latest ImageMagick
uses: actions/cache@v3
with:
path: /home/runner/bin/magick
key: ${{ runner.os }}-imagemagick-latest
restore-keys: |
${{ runner.os }}-imagemagick-latest
# Update PATH for ImageMagick
- name: Update PATH for ImageMagick
run: echo "/home/runner/bin" >> $GITHUB_PATH
- name: Create symlink for identify and convert
run: |
for cmd in identify convert; do
if ! [ -x "$(command -v $cmd)" ]; then
sudo ln -s $(which magick) /usr/bin/$cmd
fi
done
# Starting ruby
- name: setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4.8
bundler-cache: true
- name: setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
- name: Grant parallel DB permissions
run: |
mysql -h 127.0.0.1 -P 3306 -u root -pwikiedu \
-e "GRANT ALL PRIVILEGES ON \`dashboard_testing%\`.* TO 'wiki'@'%'; FLUSH PRIVILEGES;"
- name: setup Dashboard database
env:
RAILS_ENV: test
DATABASE_PORT: 3306
run: |
mkdir tmp -m 777
cp config/application.example.yml config/application.yml
cp config/database.example.yml config/database.yml
bundle exec rake parallel:create[3] parallel:load_schema[3]
- name: Check eager loading (catch autoloading issues)
env:
RAILS_ENV: test
DATABASE_PORT: 3306
run: bundle exec rails runner "Rails.application.eager_load!"
- name: Cache Webpack cache
id: cache-webpack
uses: actions/cache@v3
with:
path: node_modules/.cache/
key: ${{ runner.os }}-webpack
# Create cache or restore cache for Tests
- name: Cache VCR cassettes
uses: actions/cache@v3
with:
path: fixtures/vcr_cassettes
key: vcr-cached-v1
restore-keys: |
vcr-cached-
#Testing the pushed code onwards
- name: JavaScript test suite
run: |
yarn install --immutable
yarn coverage
yarn run test
- name: JavaScript linting
run: yarn lint-non-build
#temporarily disabling Code Climate coverage upload to fix failing CI builds.
# - name: Ruby rspec test suite
# uses: paambaati/codeclimate-action@v3.0.0
# env:
# COVERAGE: true
# CC_TEST_REPORTER_ID: f0d5d763ddc6b3f980ba0fb0c38e7c27c0dffc4a5787cd7d5b8c2b0c3b2e27e2
# with:
# coverageCommand: bundle exec rspec spec/ --color --profile --format documentation
# coverageLocations: |
# ${{github.workspace}}/public/js_coverage/lcov.info:lcov
- name: Cache parallel runtime log
uses: actions/cache@v3
with:
path: tmp/parallel_runtime_rspec.log
key: parallel-runtime-${{ hashFiles('spec/**/*_spec.rb') }}
restore-keys: parallel-runtime-
- name: Ruby rspec test suite
env:
COVERAGE: true
run: bundle exec parallel_rspec spec/ -n 3 --runtime-log tmp/parallel_runtime_rspec.log
- name: Generate JS coverage report
if: success()
env:
COVERAGE: true
run: bundle exec rake generate:coverage
- name: Archive capybara failure screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: dist-without-markdown
path: tmp/screenshots/*.png
if-no-files-found: ignore
- name: Check whitespace
run: git diff --check HEAD~1
- name: Ruby linting
run: bundle exec rubocop