AO3-6983 Add support form notices #7497
Workflow file for this run
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
| name: Automated Tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| pull_request: | |
| branches: | |
| - master | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| automated-tests: | |
| name: ${{ matrix.tests.command }} ${{ matrix.tests.arguments }} | |
| runs-on: ubuntu-latest | |
| env: | |
| CI: true | |
| RAILS_ENV: test | |
| TEST_GROUP: ${{ matrix.tests.command }} ${{ matrix.tests.arguments }} | |
| CUCUMBER_RETRY: 1 | |
| CUCUMBER_FORMAT: Ao3Cucumber::Formatter | |
| CUCUMBER_PUBLISH_QUIET: true | |
| SPEC_OPTS: --force-color | |
| services: | |
| database: | |
| image: mariadb:10.5.4-focal | |
| env: | |
| MYSQL_ROOT_PASSWORD: password | |
| MYSQL_DATABASE: otwarchive_test | |
| ports: | |
| - 3306:3306 | |
| elasticsearch: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:8.18.2 | |
| ports: | |
| - 9200:9200 | |
| options: >- | |
| -e="discovery.type=single-node" | |
| -e="xpack.security.enabled=false" | |
| memcached: | |
| image: memcached:1.5 | |
| ports: | |
| - 11211:11211 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| tests: | |
| - command: rake | |
| arguments: db:otwseed | |
| - command: rspec | |
| arguments: spec/controllers | |
| - command: rspec | |
| arguments: spec/models | |
| - command: rspec | |
| arguments: --exclude-pattern 'spec/{controllers,models}/**/*.rb' | |
| libvips: true | |
| - command: cucumber | |
| arguments: features/admins | |
| libvips: true | |
| - command: cucumber | |
| arguments: features/bookmarks | |
| - command: cucumber | |
| arguments: features/collections | |
| libvips: true | |
| - command: cucumber | |
| arguments: features/comments_and_kudos | |
| - command: cucumber | |
| arguments: features/gift_exchanges | |
| - command: cucumber | |
| arguments: features/importing | |
| vcr: true | |
| - command: cucumber | |
| arguments: features/other_a | |
| libvips: true | |
| - command: cucumber | |
| arguments: features/other_b | |
| libvips: true | |
| - command: cucumber | |
| arguments: features/prompt_memes_a | |
| - command: cucumber | |
| arguments: features/prompt_memes_b | |
| - command: cucumber | |
| arguments: features/prompt_memes_c | |
| - command: cucumber | |
| arguments: features/search | |
| - command: cucumber | |
| arguments: features/tag_sets | |
| - command: cucumber | |
| arguments: features/tags_and_wrangling | |
| - command: cucumber | |
| arguments: features/users | |
| - command: cucumber | |
| arguments: features/works | |
| ebook: true | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| - name: Install redis | |
| uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 | |
| with: | |
| packages: redis-server | |
| version: "1.0" | |
| - name: Start up redis servers | |
| run: ./script/gh-actions/multiple_redis.sh | |
| - name: Install ebook converters | |
| if: ${{ matrix.tests.ebook }} | |
| uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 | |
| with: | |
| packages: calibre zip | |
| version: "1.0" | |
| - name: Cache VCR cassettes | |
| if: ${{ matrix.tests.vcr }} | |
| uses: actions/cache@v4 | |
| with: | |
| path: features/cassette_library | |
| # Unfortunately, the actions/cache@v4 version doesn't allow the cache | |
| # key to be overwritten if there's an exact match. So instead we add | |
| # a unique identifier to the key to always force a "cache miss", and | |
| # restore from related keys to make sure that we still get to load a | |
| # recent version of the cached folder. More explanation here: | |
| # | |
| # https://github.com/actions/cache/issues/109#issuecomment-558771281 | |
| # | |
| # It's hacky, but until the cache action is more configurable, it's | |
| # the best we can do. | |
| key: cassette-library-${{ hashFiles(matrix.tests.arguments) }}-${{ github.run_id }}-${{ github.run_attempt }} | |
| restore-keys: | | |
| cassette-library-${{ hashFiles(matrix.tests.arguments) }}- | |
| - name: Install libvips for image processing | |
| if: ${{ matrix.tests.libvips }} | |
| uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 | |
| with: | |
| packages: libvips-dev | |
| version: "1.0" | |
| - name: Set up Ruby and run bundle install | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: Copy config files | |
| run: | | |
| cp config/gh-actions/database.yml config/database.yml | |
| cp config/gh-actions/redis.yml config/redis.yml | |
| cp config/gh-actions/local.yml config/local.yml | |
| - name: Set transaction isolation level | |
| run: ./script/gh-actions/configure_database.sh | |
| - name: Make database | |
| run: bundle exec rake db:create db:schema:load db:migrate | |
| - name: Run test group | |
| run: bundle exec ${{ matrix.tests.command }} ${{ matrix.tests.arguments }} | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| # Optional for public repos. However, individual forks can set this | |
| # secret to reduce the chance of being rate-limited by GitHub. | |
| # | |
| # https://github.com/marketplace/actions/codecov#usage | |
| # https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954 | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload failure screenshots | |
| if: ${{ failure() && matrix.tests.command == 'cucumber' }} | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: test failures ${{ hashFiles('tmp/capybara/*') }} | |
| path: tmp/capybara |