github - 使用 Github 操作的 Cypress <> Heroku 集成
问题描述
我想使用 github 操作将 cypress 与 heroku 管道集成。以下是我尝试过的以及我面临的问题。
我在我的 vuejs 项目中创建了一个端到端测试,并添加了 github 工作流程,如下所示
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Running e2e tests on cypress!
# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: npm run install && npm run build && npm run cypress:run
问题是,每当我将代码推送到 github master 分支时,都会在 heroku 和 github 中进行构建。
我不希望这种情况发生。我希望构建只发生在heroku中。然后在 heroku 中构建完成后,在 heroku 服务器中使用 cypress 和 github 操作运行端到端测试。我怎样才能做到这一点?
解决方案
推荐阅读
- php - 在 WHILE LOOP 内更新查询:为 Bisi 虚拟牛群增加权重
- c# - 如何在 C# 中停止复制 rdlc 报告中的行
- php - 在 PHP 中使用数组作为请求标头
- r - How can I find the most common sequences in my data using R?
- google-docs-api - 如何从 Google Docs API 的文档中获取页面的 startIndex 和 endIndex?
- python - 我们如何对使用 google-ads 编写的应用程序进行集成测试?
- python - 如何选择价值?
- c# - 如何使用带有主应用程序的 OpenTelemetry 在任何数据库中保存行跟踪数据
- sql - Oracle SQL根据其他列的值添加新列
- c# - 如何使用 C# 中的指针安全地清除 TextBox 的内容?