我正在创建一个 github docker 容器操作,其中涉及许多依赖项 python、node、pypi 包和 npm 包。为了加快操作速度,我将大量依赖项安装从入口点移至 Dockerfile。现在我的动作运行得非常快,但每次构建动作都需要很长时间。
有没有办法可以预先构建该操作,或者我是否需要将我的操作 docker 映像发布到某处的存储库并从我的自定义映像提供数据?
作为参考,这是我的 Dockerfile。
FROM python:3
LABEL "com.github.actions.name"="kedro-action"
LABEL "com.github.actions.description"="A Github Action to run kedro commands"
LABEL "com.github.actions.icon"="it-branch"
LABEL "com.github.actions.color"="black"
LABEL "repository"="http://github.com/WaylonWalker/kedro-action"
LABEL "maintainer"="Waylon Walker <waylon@waylonwalker.com>"
RUN apt-get update
RUN apt-get install -y jq
ENV PYENV_ROOT /root/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
### INSTALL PYTHON ###
RUN pyenv install 3.7.6
RUN pyenv global 3.7.6
RUN python -m pip install --upgrade pip
RUN pip install kedro
RUN …Run Code Online (Sandbox Code Playgroud) docker docker-repository github-actions github-package-registry
我正在尝试使用问题前缀来使我的提交格式如下所述
JIRA-ID: type(scope): Subject
Run Code Online (Sandbox Code Playgroud)
范围应该是可选的。这意味着以下是有效的消息
AAAA-12:修复(测试):修复了失败的测试
AAAA-12:修复:修复了失败的测试
以下是我的commitlint.config.js的样子
module.exports = {
extends: ['@commitlint/config-conventional'],
parserPreset: {
parserOpts: {
headerPattern: /^[A-Z]{1,4}-[0-9]{1,4}:\s(\w*)\((\w*)\):\s(.*)$/,
headerCorrespondence: ["type", "scope", "subject"],
issuePrefixes: ["^[A-Z]{1,4}-[0-9]{1,4}"],
referenceActions: ["xxx-"] // (!!)
}
},
rules: {
'references-empty': [2, 'never'],
'scope-empty': [1, 'never'],
...
...
}
}
Run Code Online (Sandbox Code Playgroud)
以下消息似乎无效。
AAAA-12: fix: fixed the failing test
Run Code Online (Sandbox Code Playgroud)
它迫使我使用空括号,如下所述。
AAAA-12(): fix: fixed the failing test
Run Code Online (Sandbox Code Playgroud) 我正在尝试为具有 Swift Package Manager 依赖项的项目获取 Github Actions。
我不断收到此错误:xcodebuild: error: Could not resolve package dependencies:15 The server SSH fingerprint failed to verify.
...当 Actions 运行并解析 Package Graph 时,会在使用 Swift Package Manager 的项目中获取依赖项。
我的步骤失败了:
- name: Build and Test
run: |
xcodebuild clean test -project xyz.xcodeproj -scheme xyz -destination "platform=iOS Simulator,OS=13.3,name=iPhone 8" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO
Run Code Online (Sandbox Code Playgroud)
我尝试添加for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts每个Xcode 11 解析包,但 SSH 指纹失败,但仍然无法使其工作,我可能将其放在错误的位置或做错了。
有没有人能帮助我完成这项工作?
我目前正在尝试使用 GitHub Actions 运行我的Instrumentation 测试。我的单元测试运行良好,但我似乎无法运行 Espresso 测试。我目前正在尝试:
- name: Run Instrumentation Tests (reactivecircus)
uses: reactivecircus/android-emulator-runner@v2.6.1
with:
api-level: 23
target: default
arch: x86
profile: Nexus 6
script: ./gradlew connectedCheck --stacktrace
Run Code Online (Sandbox Code Playgroud)
我得到结果:
com.balsdon.ratesapp.behaviour.RateListActivityEntryBehaviourInstrumentedTest > recyclerViewClickOnItemChangesMain[test(AVD) - 6.0] FAILED
android.content.res.Resources$NotFoundException: Resource ID #0x7f0700d3
at android.content.res.Resources.getValue(Resources.java:1351)
Tests on test(AVD) - 6.0 failed: Instrumentation run failed due to 'android.content.res.Resources$NotFoundException'
> Task :app:connectedOfflinemockDebugAndroidTest FAILED
> Task :app:processOnlineecbDebugAndroidTestResources
> Task :app:processProductionDebugAndroidTestResources
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task …Run Code Online (Sandbox Code Playgroud) 过去 2 个月,我一直在我的一个项目中使用 github actions,以使用appleboy/scp-action. 到目前为止一切正常。
但在过去 3 天中,该操作始终出现以下错误:
tar all files into /tmp/762144744/PmqnH47N72.tar
scp file to server.
drone-scp error: error copy file to dest: ***, error message: dial tcp ***:***: i/o timeout
2020/04/02 03:12:52 error copy file to dest: ***, error message: dial tcp ***:***: i/o timeout
Run Code Online (Sandbox Code Playgroud)
我已尝试timeout根据文档使用 来增加它,但没有用。有什么猜测吗???
提前致谢。
我正在尝试将 Github Actions 设置为: -build .net Core 应用程序 -测试应用程序(单元测试) -发布版本(dotnet 发布) -部署到 ftp 服务器
我在最后一步遇到一些问题。我正在使用此操作部署到 ftp:https ://github.com/SamKirkland/FTP-Deploy-Action
它始终部署整个存储库,而不仅仅是发布文件。
我的工作流程:
name: BuildAndTest
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install dependencies
run: dotnet restore
- name: Build with dotnet
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: …Run Code Online (Sandbox Code Playgroud) 我已经创建了一个关于创建存储库标签的 GitHub 操作。我成功地构建了 Docker 映像并将其推送到 AWS,但是我不知道如何使用与 GitHub 标签相同的名称来标记该映像。下面是我的 git 工作流程文件
name: Build Docker Image and Push to AWS ECR
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ secrets.AWS_REGISTRY }}
ECR_REPOSITORY: …Run Code Online (Sandbox Code Playgroud) 我创建了工作流程来在提交之前测试我的 Python 应用程序。问题是,如果测试失败,提交无论如何都会被推送。如果测试不成功,我如何添加一个条件来避免推送?
工作流程文件 .yml 的结构如下。
name: Python application
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . …Run Code Online (Sandbox Code Playgroud) 我正在学习 Github Actions 并设计一个需要Service Container 的作业的工作流程。
文档指出配置必须指定“用作运行操作的服务容器的 Docker 映像。该值可以是 Docker 基本映像名称或公共 docker Hub 或注册表”。文档中的所有示例都使用公开可用的 Docker 映像,但是我想从我的存储库中包含的 Dockerfile 创建服务容器。
是否可以使用本地 Dockerfile 创建服务容器?
由于作业依赖于服务容器,因此该映像在作业开始时必须存在,因此无法通过同一作业中的较早步骤创建该映像。该图像可以在单独的作业中构建,但由于作业在单独的运行程序中执行,我相信作业 2 将无法访问作业 1 中创建的图像。如果这是真的,那么我可以遵循这种方法,使用上传/下载-那么将作业 1 的图像提供给作业 2 吗?
如果一切都失败了,我可以让作业 1 创建映像并将其上传到 Docker Hub,然后让作业 2 从 Docker Hub 下载它,但肯定有更好的方法。
我正在尝试为使用 RabbitMQ 的应用程序设置 Github Actions CI。
RabbitMQ 容器使用以下命令启动:
services:
rabbitmq:
image: rabbitmq:3-management
ports:
- 5672:5672
Run Code Online (Sandbox Code Playgroud)
但现在我需要用类似的东西来配置它rabbitmqctl add_user user password。
如何做呢?我应该在这里使用rabbitmq容器吗?
github-actions ×10
github ×3
docker ×2
.net ×1
asp.net-core ×1
commit ×1
docker-image ×1
dotnet-cli ×1
ftp ×1
git-tag ×1
ios ×1
python ×1
rabbitmq ×1
swift ×1
testing ×1