3427 relax import list limit #25537
This file contains hidden or 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 | |
| env: | |
| PARALLEL_WORKERS: 4 | |
| 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 | |
| # 2025-05-12 JDC Skip this step for now because it hangs intermittently | |
| # and is needed only for system tests, which are currently not run in CI. | |
| # - 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 | |
| - 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: Create parallel test databases from main | |
| run: | | |
| mysqldump -u root -proot mo_test > /tmp/mo_test.sql | |
| for i in $(seq 0 $((PARALLEL_WORKERS - 1))); do | |
| mysql -u root -proot -e "DROP DATABASE IF EXISTS \`mo_test-$i\`; CREATE DATABASE \`mo_test-$i\` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;" | |
| mysql -u root -proot "mo_test-$i" < /tmp/mo_test.sql | |
| done | |
| - name: Update translation files | |
| run: bundle exec rake lang:update | |
| - name: Create log files | |
| run: | | |
| touch log/test.log | |
| touch log/production.log | |
| - name: Set up parallel test config files | |
| run: bundle exec rake parallel:test:setup | |
| # 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 | |
| lint: | |
| 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 # See Rails 8 default | |
| # https://github.com/rails/rails/blob/4a78dcb326e57b5035c4df322e31875bfa74ae23/.github/workflows/rubocop.yml#L1 | |
| - name: Run RuboCop | |
| run: bundle exec rubocop --parallel | |
| # https://github.com/reviewdog/action-brakeman | |
| - name: Run Brakeman | |
| uses: reviewdog/action-brakeman@v2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| reporter: github-pr-check | |
| fail_level: none |