Refactor by_editor condition #16771
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub Actions Continuous Integration of MO Rails Code | |
# Runs the tests and publishes the results to Coveralls | |
name: Continuous Integration | |
on: | |
push: | |
# branches: main | |
branches: | |
- "*" # Run on pushes on all branches | |
pull_request: | |
branches: main | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
# check-out repo under $GITHUB_WORKSPACE, so that workflow can access it. | |
# https://github.com/actions/checkout | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# https://github.com/ruby/setup-ruby | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true # runs bundle install, caches gems | |
- name: Install additional tools | |
run: sudo apt-get install exiftool | |
- name: Install Chrome/Chromium | |
run: sudo apt-get install chromium-browser | |
# MySQL is installed but does not run by default | |
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#mysql | |
- name: Start mySQL | |
run: sudo systemctl start mysql.service | |
# https://github.com/trilogy-libraries/activerecord-trilogy-adapter/issues/64 | |
# Issue in the trilogy gem where it cannot support `caching_sha2_password` | |
# https://github.com/trilogy-libraries/trilogy/issues/26 | |
# For now need to ensure user is IDENTIFIED WITH `mysql_native_password` | |
# (change is in db/initialize.sql) | |
- name: Create and configure db | |
run: | | |
mysql -u root -proot < db/initialize.sql | |
cp db/vagrant/database.yml config | |
- name: Create test image directories | |
run: | | |
for dir in images test_images; | |
do | |
for subdir in thumb 320 640 960 1280 orig; | |
do | |
mkdir -p public/$dir/$subdir | |
done | |
done | |
- name: install exifautotran | |
run: | | |
sudo cp script/exifautotran /usr/local/bin/exifautotran | |
sudo chmod 755 /usr/local/bin/exifautotran | |
- name: Load fixtures | |
run: | | |
bundle exec rake db:schema:load | |
bundle exec rake db:fixtures:load | |
- name: Update translation files | |
run: bundle exec rake lang:update | |
# And finally we can run the test suite | |
- name: Run tests | |
env: | |
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
run: bundle exec rails test | |
# https://github.com/marketplace/actions/coveralls-github-action | |
- name: Coveralls GitHub Action | |
uses: coverallsapp/github-action@main | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./coverage/lcov/lcov.info | |
# https://github.com/devmasx/brakeman-linter-action | |
# Temporarily disable brakeman in CI because it causes an error | |
# See https://github.com/MushroomObserver/mushroom-observer/issues/1514 | |
# Instead use brakeman's plugin. See .codeclimate.yml | |
# JDC 2023-06-05 | |
# - name: brakeman report | |
# run: | | |
# bundle exec brakeman -f json > brakeman.json || exit 0 | |
# - name: Brakeman | |
# uses: devmasx/[email protected] | |
# env: | |
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
# REPORT_PATH: brakeman.json |