Skip to content

Handle Locales in URL Paths #12083

Handle Locales in URL Paths

Handle Locales in URL Paths #12083

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
rails:
strategy:
fail-fast: false
matrix:
tests:
- id: general
name: General
command: test
- id: system
name: System
command: test:system
- id: avo-without-pro
name: Avo (without Pro)
command: "test test/*/avo"
name: Rails tests ${{ matrix.tests.name }}
runs-on: ubuntu-24.04
timeout-minutes: 60
permissions:
contents: read
env:
RUBYGEMS_VERSION: "4.0.16"
# Fail hard when Toxiproxy is not running to ensure all tests (even Toxiproxy optional ones) are passing
REQUIRE_TOXIPROXY: true
TOXIPROXY_LISTEN_HOST: "0.0.0.0"
TOXIPROXY_UPSTREAM: "search:9200"
RUBYGEMS_ORG_SECRETS_AVAILABLE: ${{ github.repository == 'rubygems/rubygems.org' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'rubygems/rubygems.org') }}
REQUIRE_AVO_PRO: ${{ github.repository == 'rubygems/rubygems.org' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'rubygems/rubygems.org') && matrix.tests.id != 'avo-without-pro' }}
AVO_LICENSE_KEY: ${{ secrets.AVO_LICENSE_KEY }}
BUNDLE_PACKAGER__DEV: ${{ secrets.BUNDLE_PACKAGER__DEV }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Fork CI note
if: env.RUBYGEMS_ORG_SECRETS_AVAILABLE != 'true'
run: |
echo "::notice::Running fork-friendly CI without RubyGems.org-only secrets. Avo Pro tests and Codecov upload are disabled."
echo "### Fork CI" >> "$GITHUB_STEP_SUMMARY"
echo "RubyGems.org-only secrets are unavailable in forks, so this run skips Avo Pro setup and Codecov upload." >> "$GITHUB_STEP_SUMMARY"
- name: Setup rubygems.org
uses: ./.github/actions/setup-rubygems.org
with:
ruby-version: .ruby-version
rubygems-version: ${{ env.RUBYGEMS_VERSION }}
install-avo-pro: ${{ env.RUBYGEMS_ORG_SECRETS_AVAILABLE == 'true' && matrix.tests.id != 'avo-without-pro' }}
install-playwright: ${{ matrix.tests.id != 'general' }}
- name: Tests ${{ matrix.tests.name }}
id: test-all
run: |
# Intentional splitting and glob expansion for the static matrix command.
# shellcheck disable=SC2086
bin/rails $TEST_COMMAND
env:
TEST_COMMAND: ${{ matrix.tests.command }}
- name: Save capybara screenshots
if: ${{ failure() && steps.test-all.outcome == 'failure' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: capybara-screenshots-${{ matrix.tests.name }}
path: tmp/capybara
if-no-files-found: ignore
- name: Upload coverage to Codecov
if: env.RUBYGEMS_ORG_SECRETS_AVAILABLE == 'true' && matrix.tests.id != 'avo-without-pro' && (success() || failure())
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}