我目前正在尝试将 GitHub 操作工作流添加到存储库...
要进行 C++/CMake/swig/python 开发(即本机 python 库开发),我需要下载并安装 swigwin 并使其在PATH...
不幸的$env:Path...是,在接下来的后续步骤中似乎没有考虑该命令
name: Python Windows CI
on: [push, pull_request]
jobs:
# Building using the GitHub runner environment directly.
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Install swig
run: |
(New-Object System.Net.WebClient).DownloadFile("http://prdownloads.sourceforge.net/swig/swigwin-4.0.1.zip","swigwin-4.0.1.zip");
Expand-Archive .\swigwin-4.0.1.zip .;
$env:Path += ";.\swigwin-4.0.1";
swig -version;
- name: Check swig
run: swig -version # swig cmdlet not found...
Run Code Online (Sandbox Code Playgroud)
> Set up …Run Code Online (Sandbox Code Playgroud) 我的 github 存储库配置出现问题。这是 - umbress。我启用并配置了 Github Actions CI,我希望在我的 repo 中有覆盖徽章,这样每个想要在他们的项目中使用我的代码的人都知道我的代码经过了良好的测试。但似乎我错过了一些东西,因为我的报道徽章已经有很长一段时间了。
CI步骤是:
jest --coverage --config config/jest.js)。这将./coverage/lcov.info在根目录中生成有几个问题:

FIRST BUILD ON DEVELOPER AT 90.072%,但根本没有这样的百分比!覆盖的行是93.43%,平均所有的是89.4%)我做错了什么,我应该怎么做才能解决这个问题?
continuous-integration code-coverage coveralls github-actions
我在 React 中使用 Firebase,在初始化 Firebase 时,我使用从我的 .env 文件中提取的环境变量dotenv。我想构建我的 React 应用程序并将其部署到 Firebase 托管,我将 GitHub Actions 与以下 .yml 工作流文件一起使用:
name: Deploy
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: public
path: public
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- …Run Code Online (Sandbox Code Playgroud) environment-variables continuous-deployment firebase firebase-hosting github-actions
有没有办法缓存 docker-compose 以便它不会一次又一次地构建?这是我的操作工作流文件:
name: Github Action
on:
push:
branches:
- staging
jobs:
test:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Bootstrap app on Ubuntu
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install global packages
run: npm install -g yarn prisma
- name: Install project deps
if: steps.cache-yarn.outputs.cache-hit != 'true'
run: yarn
- name: Build docker-compose
run: docker-compose -f docker-compose.test.prisma.yml up --build -d
Run Code Online (Sandbox Code Playgroud)
我想缓存 docker build 步骤。我试过使用if: steps.cache-docker.outputs.cache-hit != 'true' then only build 但没有用。
github docker-compose docker-build github-actions building-github-actions
我想传递一些动态参数并手动调用我的 GitHub 操作工作流(最好通过一些 API)。这可能吗?
您如何在 GitHub Actions 中将存储库名称(而不是用户或组织)作为环境变量获取?我发现github.repository,但却包含了所有者,像这样的第一部分:owner/repo。
我正在通过此 GitHub Action部署 Firebase Cloud Function 。当我使用服务帐户从我自己的机器部署时,它工作正常。使用相同的服务帐户运行操作时,我遇到了以下错误。
最终错误:
错误:错误获取存储源:通用::未知:重试预算用尽(3次尝试):获取gcs源:从gcs解包源:源提取容器以非零状态退出:9
之前的日志:
未找到中央目录结尾签名。该文件不是一个 zipfile,或者它构成了一个多部分存档的磁盘。在后一种情况下,将在此存档的最后一个磁盘上找到中央目录和 zipfile 注释。解压缩:在 /tmp/source-archive.zip 或 /tmp/source-archive.zip.zip 之一中找不到 zipfile 目录,并且找不到 /tmp/source-archive.zip.ZIP,句号。
这是我的操作 yml:
name: Deploy
on:
pull_request:
branches:
- master
jobs:
integration-test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: checkout repo and set up Node.js v12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: cd ./functions/ && npm install
- id: deploy
name: Deploy my_function to Cloud Functions
uses: google-github-actions/deploy-cloud-functions@v0.1.2
with:
name: …Run Code Online (Sandbox Code Playgroud) github firebase google-cloud-platform google-cloud-functions github-actions
假设我有 2 个分支,一个功能分支和一个开发分支。
功能分支上通常没有 SLA,这意味着我可以整天将损坏的代码推送到它,并且不应触发 CI 构建。
然后我打开一个 PR 进行开发。我在 pull_request: created 上触发 CI 构建操作。假设这个构建失败了。默认情况下我无法合并 PR,这是正确的。
现在我想将编辑推送到功能分支以更新 PR。我希望这些推送触发 CI 构建(因为我们现在正在一个开放的 PR 中工作)。在这些 push-CI 通过之前,我不想让 PR 继续/合并。
我如何在 GitHub Actions 中做到这一点?我试过了,on pull_request: edited但这对我不起作用。
我正在寻找功能等价物:
on:
push:
if: inside_open_pr
Run Code Online (Sandbox Code Playgroud) 我正在使用GitHub Actions来触发我的dockerfile的构建,它将容器上传到GitHub Container Registry。在最后一步中,我通过SSH连接到我的远程DigitalOcean Droplet 并执行脚本以从 GHCR拉取和安装新映像。这个工作流程对我很有用,因为我只在项目中构建了一个容器。现在我正在使用docker compose,因为除了 API 之外我还需要 NGINX。我想保持在一个容器单滴,因为该项目目前对资源的要求不高。
在单个 VM 上使用 Github Actions 和 Docker Compose 自动部署到 DigitalOcean 的正确方法是什么?
我目前已知的选项是:
如果您知道更多选择,这可能更清洁或更高效,请告诉我!
不幸的是,我找到了一个docker-compose with Github Actions for CI 问题以供参考。
单个容器的 GitHub 操作
name: Github Container …Run Code Online (Sandbox Code Playgroud) 我是一些 Julia GitHub 存储库的维护者,这些存储库通过 cron 使用 GitHub Actions 进行夜间 CI 运行。其中一些软件包几个月都没有得到维护,但在生态系统中使用,我想让它们保持活跃。GitHub 的当前政策是在 60 天内没有发生存储库活动时禁用这些操作。
我想知道是否有定义什么存储库活动是为了防止操作被禁用。这是评论一个问题那么简单吗?还是需要将提交推送到主分支?
其次,有没有人找到保持存储库活跃的好解决方案?我正在考虑创建一个每 59 天运行一次的 Lambda 函数,并执行某种形式的存储库活动以保持活动状态。我只找到了这个HackerNews帖子,它提出了这个问题,但是没有评论:
默认情况下,在公共存储库的分支和连续 60 天没有活动的公共存储库中,计划工作流将被禁用。我们对 GitHub Actions 的使用政策进行了两项更改。这些变化将使 GitHub Actions 能够随着我们从 GitHub 社区看到的令人难以置信的采用而扩展。这是一个快速概述:
从今天开始,默认情况下将在公共存储库的新分支中禁用计划工作流。
在连续 60 天没有活动的公共存储库中,计划工作流将被禁用。
github-actions ×10
github ×7
firebase ×2
coveralls ×1
docker ×1
docker-build ×1
github-api ×1
path ×1
powershell ×1
yaml ×1