From 0731b812c588bf799fa96bc8a789917e1f730fa9 Mon Sep 17 00:00:00 2001 From: meyric Date: Fri, 5 Apr 2024 15:26:30 +0100 Subject: [PATCH] WIP --- .github/workflows/rails-integration-tests.yml | 150 ++++++++++++++++-- 1 file changed, 140 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rails-integration-tests.yml b/.github/workflows/rails-integration-tests.yml index b7d3629..ce2d13e 100644 --- a/.github/workflows/rails-integration-tests.yml +++ b/.github/workflows/rails-integration-tests.yml @@ -7,8 +7,8 @@ on: - v2 jobs: - rails-5: - name: Rails 5 mailer previews + build-rails-5: + name: Build Rails 5 runs-on: ubuntu-latest steps: - @@ -29,15 +29,62 @@ jobs: push: false load: true tags: mail-notify-integration-rails-5:latest + outputs: type=docker, dest=/tmp/rails-5-image.tar cache-from: type=gha cache-to: type=gha,mode=min + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: rails-5-image + path: /tmp/rails-5-image.tar + + rails-5-previews: + name: Rails 5 mailer previews + runs-on: ubuntu-latest + needs: build-rails-5 + steps: + - + name: Download image + uses: actions/download-artifact@v4 + with: + name: rails-5-image + path: /tmp + - + name: Load image + run: docker load --input /tmp/rails-5-image.tar - name: Run integration tests env: NOTIFY_API_KEY: ${{ secrets.NOTIFY_API_KEY }} - run: docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" mail-notify-integration-rails-5:latest - rails-6: - name: Rails 6 mailer previews + run: | + docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" \ + mail-notify-integration-rails-5:latest bin/rails test:system + + + rails-5-sending: + name: Rails 5 sending + runs-on: ubuntu-latest + needs: build-rails-5 + steps: + - + name: Download image + uses: actions/download-artifact@v4 + with: + name: rails-5-image + path: /tmp + - + name: Load image + run: docker load --input /tmp/rails-5-image.tar + - + name: Run integration tests + env: + NOTIFY_API_KEY: ${{ secrets.NOTIFY_API_KEY }} + run: | + docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" \ + mail-notify-integration-rails-5:latest bin/rails test + + build-rails-6: + name: Build Rails 6 runs-on: ubuntu-latest steps: - @@ -60,14 +107,58 @@ jobs: tags: mail-notify-integration-rails-6:latest cache-from: type=gha cache-to: type=gha,mode=min + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: rails-6-image + path: /tmp/rails-6-image.tar + + rails-6-previews: + name: Rails 6 mailer previews + runs-on: ubuntu-latest + needs: build-rails-6 + steps: + - + name: Download image + uses: actions/download-artifact@v4 + with: + name: rails-6-image + path: /tmp + - + name: Load image + run: docker load --input /tmp/rails-6-image.tar - name: Run integration tests env: NOTIFY_API_KEY: ${{ secrets.NOTIFY_API_KEY }} - run: docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" mail-notify-integration-rails-6:latest + run: \ + docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" \ + mail-notify-integration-rails-6:latest bin/rails test:system - rails-7: - name: Rails 7 mailer previews + rails-6-sending: + name: Rails 6 sending + runs-on: ubuntu-latest + needs: build-rails-6 + steps: + - + name: Download image + uses: actions/download-artifact@v4 + with: + name: rails-6-image + path: /tmp + - + name: Load image + run: docker load --input /tmp/rails-6-image.tar + - + name: Run integration tests + env: + NOTIFY_API_KEY: ${{ secrets.NOTIFY_API_KEY }} + run: | + docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" \ + mail-notify-integration-rails-6:latest bin/rails test + + build-rails-7: + name: Build Rails 7 runs-on: ubuntu-latest steps: - @@ -89,9 +180,48 @@ jobs: load: true tags: mail-notify-integration-rails-7:latest cache-from: type=gha - cache-to: type=gha,mode=min + cache-to: type=gha,mode=max + + rails-7-previews: + name: Rails 7 mailer previews + runs-on: ubuntu-latest + needs: build-rails-7 + steps: + - + name: Download image + uses: actions/download-artifact@v4 + with: + name: rails-7-image + path: /tmp + - + name: Load image + run: docker load --input /tmp/rails-7-image.tar + - + name: Run integration tests + env: + NOTIFY_API_KEY: ${{ secrets.NOTIFY_API_KEY }} + run: | + docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" \ + mail-notify-integration-rails-7:latest bin/rails test:system + + rails-7-sending: + name: Rails 7 sending + runs-on: ubuntu-latest + needs: build-rails-7 + steps: + - + name: Download image + uses: actions/download-artifact@v4 + with: + name: rails-7-image + path: /tmp + - + name: Load image + run: docker load --input /tmp/rails-7-image.tar - name: Run integration tests env: NOTIFY_API_KEY: ${{ secrets.NOTIFY_API_KEY }} - run: docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" mail-notify-integration-rails-7:latest + run: | + docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" \ + mail-notify-integration-rails-7:latest bin/rails test