Run flatware on CI

Matt Jankowski 2024-05-14 15:32:04 -04:00
parent 6d3fbf939e
commit 9a61df1ca0
2 changed files with 17 additions and 3 deletions

View File

@ -132,15 +132,17 @@ jobs:
additional-system-dependencies: ffmpeg libpam-dev
- name: Load database schema
run: './bin/rails db:create db:schema:load db:seed'
run: |
bin/rails db:setup
bin/flatware fan bin/rails db:test:prepare
- run: bin/rspec
- run: bin/flatware rspec -r ./spec/flatware_helper.rb
- name: Upload coverage reports to Codecov
if: matrix.ruby-version == '.ruby-version'
uses: codecov/codecov-action@v4
with:
files: coverage/lcov/mastodon.lcov
files: coverage/lcov/*.lcov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

12
spec/flatware_helper.rb Normal file
View File

@ -0,0 +1,12 @@
# frozen_string_literal: true
if defined?(Flatware)
Flatware.configure do |config|
config.after_fork do |test_env_number|
unless ENV.fetch('DISABLE_SIMPLECOV', nil) == 'true'
require 'simplecov'
SimpleCov.at_fork.call(test_env_number) # Combines parallel coverage results
end
end
end
end