使用 Travis 为 .NET Core 设置 CI [英] Set up CI with Travis for .NET Core

查看:20
本文介绍了使用 Travis 为 .NET Core 设置 CI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的 .NET Core 3.1 类库设置 CI.我在

解决方案

您正在使用:

dist: trusty

那是 Ubuntu 14.04.6 LTS不受 .NET Core 3.1 支持.尝试更新版本的 Ubuntu,例如 bionic.

这也在 travis 中得到了回答社区帖子:

<块引用>

dotnet-sdk-3.0 不适用于 Trusty(大概是因为它是 EOL):https://packages.microsoft.com/ubuntu/14.04/prod/dists/trusty/main/binary-amd64/Packages 移动到 dist:xenial(这是默认,所以你可以省略它)或 dist:仿生.

I'm trying to set up a CI for my .NET Core 3.1 class library. I created an account at https://travis-ci.org/github and selected my repository containing the code for my class library for a CI build.

Travis is successfully watching my master branch for commits, but I cannot get the CI build to succeed.

But somehow this always errors, this time with the following output:

  • Clean output:

    docker stop/waiting
    resolvconf stop/waiting
    C# support for Travis-CI is community maintained.
    Please open any issues at https://travis-ci.community/c/languages/37-category and cc @joshua-anderson @akoeplinger @nterry
    Installing .NET Core
    $ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
    $ export DOTNET_CLI_TELEMETRY_OPTOUT=1
    E: Unable to locate package dotnet-sdk-3.1
    E: Couldn't find any package by glob 'dotnet-sdk-3.1'
    E: Couldn't find any package by regex 'dotnet-sdk-3.1'
    The command "sudo apt-get install -qq dotnet-sdk-3.1=3.1.302*" failed and exited with 100 during .
    Your build has been stopped.
    

  • Raw output: https://api.travis-ci.org/v3/job/709293291/log.txt

What's wrong with my travis.yml configuration. Why can't I CI test my class library with this config?

I mainly want to CI test for .NET Core. If mono could be included this would be very nice. All the examples you'd find in the git history are also examples that I digged up in other repositories.

解决方案

You are using:

dist: trusty

That's Ubuntu 14.04.6 LTS which is not supported by .NET Core 3.1. Try a newer version of Ubuntu such as bionic.

This is also answered in the travis community post:

dotnet-sdk-3.0 is not available for Trusty (presumably because it’s EOL): https://packages.microsoft.com/ubuntu/14.04/prod/dists/trusty/main/binary-amd64/Packages Move to dist: xenial (which is the default so you can just omit it) or dist: bionic.

这篇关于使用 Travis 为 .NET Core 设置 CI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆