ruby 在Github工作流中安装Mailcatcher需要花费很长时间

d7v8vwbk  于 11个月前  发布在  Ruby
关注(0)|答案(1)|浏览(93)

更新1:得到mailatcher工作,但运行每个测试现在需要4分钟。
我需要在Github工作流中进行一些Mailcatcher验收测试。所有其他测试都运行良好。我也运行了Mailcatcher,但安装所有依赖项的gem需要大约4分钟(!),这是不可接受的。
有什么方法可以加快速度吗?环境是LAMP。
这就是YAML文件:

name: Codeception Tests

on: [push]

jobs:
  tests:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      fail-fast: true
      matrix:
        operating-system: [ubuntu-latest]
        php: ["7.4"]
    name: PHP ${{ matrix.php }} Test on ${{ matrix.operating-system }}

    env:
      php-ini-values: post_max_size=32M

    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          ref: "develop"

      - name: Checkout Tests
        uses: actions/checkout@v2
        with:
          repository: xxx/tests
          ref: "develop"
          path: tests

      - name: Install Ruby & run mailcatcher
        run: |            
          sudo gem install mailcatcher
          mailcatcher

字符串
composer.json

{
    "name": "tests",
    "description": "Tests",
    "license": "GPL-2.0-or-later",
    "require-dev": {
        "codeception/codeception": "~4.0",
        "codeception/module-asserts": "^1.0",
        "codeception/module-webdriver": "^1.0",
        "codeception/module-phpbrowser": "^1.0",
        "codeception/module-filesystem": "^1.0",
        "codeception/module-db": "^1.0",
        "joomla-projects/joomla-browser": "@dev",
        "joomla-projects/selenium-server-standalone": "~v3",
        "fzaninotto/faker": "^1.6",
        "behat/gherkin": "^4.4.1",
        "phing/phing": "2.*",
        "captbaritone/mailcatcher-codeception-module": "^2.2"
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/stell/joomla-browser"
        }
    ]
}


Acceptance Suite:

class_name: AcceptanceTester
modules:
  enabled:
    - Asserts
    - JoomlaBrowser
    - Helper\Acceptance
    - DbHelper
    - Filesystem
    - MailCatcher

  config:
    MailCatcher:
      url: "http://127.0.0.1"
      port: "1080"
    JoomlaBrowser:
      url: "http://127.0.0.1:800

rn0zuynd

rn0zuynd1#

2岁的问题,但希望这能帮助一些人...
如果可以的话,你可以使用GitHub Actions上的Docker容器来托管Mailcatcher。对我来说,Mailcatcher在GH上大约需要20秒而不是5分钟,因为ruby/mailcather不需要编译/构建包。

workflow.yml

services:
    mailcatcher:
    image: schickling/mailcatcher
    ports:
        - "1080:1080"
        - "1025:1025"

字符串

.env

SMTP_HOST: 127.0.0.1
    SMTP_PORT: 1025
    SMTP_USERNAME:
    SMTP_PASSWORD:

相关问题