diff --git a/.github/workflows/rails-integration-tests.yml b/.github/workflows/rails-integration-tests.yml index 5ad2a67..e82468f 100644 --- a/.github/workflows/rails-integration-tests.yml +++ b/.github/workflows/rails-integration-tests.yml @@ -7,6 +7,33 @@ on: - v2 jobs: + rails-5: + name: Rails 5 mailer previews + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Build and cache + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + build-args: | + RAILS_VERSION=5.2.8.1 + MAIL_NOTIFY_BRANCH=${{ github.ref }} + push: false + load: true + tags: mail-notify-integration-rails-5:latest + cache-from: type=gha + cache-to: type=gha,mode=min + - + name: Run integration tests + run: docker run --rm -e "NOTIFY_API_KEY=${{ secrets.NOTIFY_API_KEY }}" mail-notify-integration-rails-5:latest rails-6: name: Rails 6 mailer previews runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile index 3690834..6391a48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,9 @@ WORKDIR mail-notify-integration # install the gems into the bundle RUN bundle install +# remove gems that will not work in Rails 5.2.8.1 +RUN if [ "${RAILS_VERSION}" = "5.2.8.1" ]; then bundle remove selenium-webdriver chromedriver-helper; fi + # Final stage for app image FROM base @@ -49,7 +52,9 @@ RUN echo "gem 'mail-notify', git: 'https://github.com/dxw/mail-notify', branch: RUN bundle install # Copy over intergration test files -COPY test/ test/ +COPY test/mailers/ test/mailers/ +COPY test/system/ test/system/ +COPY test/application_system_test_case.rb /test/application_system_test_case.rb COPY test/app/mailers/ app/mailers/ COPY test/app/views/ app/views/ diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb new file mode 100644 index 0000000..176c5d1 --- /dev/null +++ b/test/application_system_test_case.rb @@ -0,0 +1,4 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase +end