I had the need to use .NET-Core preview and found this post
Using snap is some what faster. Snap is installed once but for each step dotnet is installed. For releases I am saving around two minutes.
Here a sample with multiple steps
sudo: required
dist: bionic
language: csharp
solution: Etdb.ServiceBase.AspNetCore.sln
mono: none
addons:
snaps:
- name: dotnet-sdk
classic: true
channel: latest/beta
stages:
- build
- test
- publish
jobs:
include:
- stage: build
name: build solution
before_script:
- sudo snap alias dotnet-sdk.dotnet dotnet
script: dotnet restore && dotnet build
- stage: test
name: run-tests
services: mongodb
before_script:
- sudo snap alias dotnet-sdk.dotnet dotnet
- sh install_link_libgdiplus.sh
- sh setup-mongodb-user.sh "$MONGODB_USERNAME" "$MONGODB_PASSWORD"
script: ./run-tests.sh
- stage: publish
name: publish-packages
if: tag IS present
before_script:
- sudo snap alias dotnet-sdk.dotnet dotnet
script: ./publish-packages.sh "$NUGET_SOURCE" "$ETDB_NUGET_APIKEY" "$TRAVIS_TAG"