Git Product home page Git Product logo

localappveyor's Introduction

.NET Core global tool which brings appveyor.yml to the center of your build process by making possible to execute its build jobs, locally.

Windows OS X / Linux Nuget
Build status Build Status Nuget

How it works

LocalAppVeyor tries to strictly follow same build pipeline as AppVeyor CI itself.

  1. Grabs appveyor.yml's build configuration from current (or specified) local repository folder.
  2. Reads supported build steps from it.
  3. Executes build pipeline for each job (or specified ones) on the build matrix.

Build engine tries to be the less intrusive as possible printing only what it comes from the build output.

Install

Install LocalAppVeyor as a .NET Core CLI global tool using the following command:

dotnet tool install -g localappveyor

You have it now available on your command line:

LocalAppVeyor --help

Requires .NET Core 3.1 or higher.

Usage

Usage: LocalAppVeyor [options] [command]

Options:
  -?|-h|--help  Show help information
  -v|--version  Show version information

Commands:
  build  Executes one or all build jobs on specified repository directory
  jobs   List all build jobs available to execution.
  lint   Validates appveyor.yml YAML configuration. It requires internet connection.

Use "LocalAppVeyor [command] --help" for more information about a command.

build command

This is the main console command which allows one to execute all or a smaller set of jobs from the build matrix. --job command should be followed by a integer corresponding to job index as listed on jobs command

Usage: LocalAppVeyor build [options]

Options:
  -?|-h|--help  Show help information
  -d|--dir      Local repository directory where appveyor.yml sits. If not specified current directory is used
  -j|--job      Job to build. You can specify multiple jobs. Use 'jobs' command to list all jobs
  -s|--skip     Step to skip from the build pipeline. You can specify multiple steps.

jobs command

Lists all available jobs on the specified appveyor YAML configuration file build matrix.

Usage: LocalAppVeyor jobs [options]

Options:
  -?|-h|--help  Show help information
  -d|--dir      Local repository directory where appveyor.yml sits. If not specified current directory is used

lint command

Validates appveyor.yml YAML configuration. It requires an active internet connection as it uses AppVeyor web API for a real and up to date validation.

Usage: LocalAppVeyor lint [options]

Options:
  -?|-h|--help  Show help information
  -t|--token    AppVeyor account API token. If not specified it tries to get it from LOCALAPPVEYOR_API_TOKEN environment variable. You can find it here: https://ci.appveyor.com/api-token
  -d|--dir      Local repository directory where appveyor.yml sits. If not specified current directory is used

Supported build steps

Due to LocalAppVeyor's nature only a subset of AppVeyor build steps are supported. Some of them might get some support later in time, after consideration, but others most likely won't ever be part of the build pipeline.

✅ Fully supported   🔵 Partially supported   🔴 Not yet supported

Step \ Option Support Notes
version {build} placeholder is replaced by 0
environment As for the standard AppVeyor variables these are the ones supported: APPVEYOR, CI, APPVEYOR_BUILD_FOLDER, APPVEYOR_BUILD_NUMBER, APPVEYOR_BUILD_VERSION, PLATFORM and CONFIGURATION
configuration
platform
os Relatively undocumented option but it exists apparently. It's usually a single value so it serves nothing other than to build the matrix job name.
init
clone_folder Tries first to clone to specified clone_folder, if any; otherwise it creates a random directory in user's temp folder. From this step on all scripts will be executed as the clone folder being the working directory.
matrix
install
assembly_info
before_build
build
build_script
after_build
before_test 🔴
test 🔴
test_script 🔵 It will always execute if it exists, no matter if other tests options are specified.
after_test 🔴
on_success
on_failure
on_finish

localappveyor's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar joaope avatar kristinita avatar pkienzle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

localappveyor's Issues

Warning about System.ComponentModel.TypeConverter during build

From the build logs, line 134:

C:\projects\localappveyor\tests\LocalAppVeyor.Engine.UnitTests\LocalAppVeyor.Engine.UnitTests.csproj : warning NU1603: Castle.Core 4.0.0 depends on System.ComponentModel.TypeConverter (>= 4.0.1) but System.ComponentModel.TypeConverter 4.0.1 was not found. An approximate best match of System.ComponentModel.TypeConverter 4.1.0 was resolved. [C:\projects\localappveyor\LocalAppVeyor.sln]

Perhaps there was a change to the appveyor systems that causes this? It happens in my local builds as well.

Support environment variables expansion on non-script configurations

As of now only scripts (batch or PowerShell) can access and use environment variables.

Should investigate which parts of appveyor.yml configuration allow variable expansion and do the same on LocalAppVeyor.

Expansion format: $(ENV_VAR_NAME)

Example: clone_folder: $(MY_FOLDER)\clones\project

feature_request(net6): run LocalAppVeyor on Ubuntu 22

1. Summary

I can’t start using LocalAppVeyor on Ubuntu 22.04 LTS (Jammy Jellyfish).

Due to the error message, a possible reason for this — LocalAppVeyor currently not support .NET 6.

#113 — possibly similar issue.

2. Steps to reproduce

  • Part of my .travis.yml:

     before_install:
     - export PATH="$PATH:/home/travis/.dotnet/tools"
    
     # [INFO] .NET 6 is included in Ubuntu 22.04:
     # https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2204
     install:
     # [INFO] Install the .NET SDK or the .NET Runtime on Ubuntu
     # as described on the official Microsoft technical documentation site:
     # https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#install-the-sdk
     - sudo apt-get install -y dotnet6
     - dotnet tool install -g localappveyor
    
     script:
     - LocalAppVeyor --version

3. Behavior

3.1. Desired

$ LocalAppVeyor --version

LocalAppVeyor
0.5.8 (engine: 0.5.8)

3.2. Current

  • Travis build:

     $ LocalAppVeyor --version
    
     You must install or update .NET to run this application.
    
     App: /home/travis/.dotnet/tools/LocalAppVeyor
    
     Architecture: x64
    
     Framework: 'Microsoft.NETCore.App', version '5.0.0' (x64)
    
     .NET location: /usr/lib/dotnet/dotnet6-6.0.108
    
     The following frameworks were found:
    
       6.0.8 at [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.NETCore.App]
    
     Learn about framework resolution:
    
     https://aka.ms/dotnet/app-launch-failed
    
     To install missing framework, download:
    
     https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x64&rid=ubuntu.22.04-x64
    
     The command "LocalAppVeyor --version" exited with 150.

Pay attention to Framework: 'Microsoft.NETCore.App', version '5.0.0' (x64) and framework_version=5.0.0.

4. Not helped

4.1. Microsoft package feed

I tried Microsoft package feed for Ubuntu 22.04:

install:
+ - wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
+ - sudo dpkg -i packages-microsoft-prod.deb
+ - rm packages-microsoft-prod.deb
  - sudo apt-get install -y dotnet6 dotnet-runtime-6.0
  - dotnet tool install -g localappveyor

Same error.

4.2. Snap

I tried to install .NET SDK via Snap:

install:
- - sudo apt-get install -y dotnet6
+ - sudo snap install dotnet-sdk --classic
+ - sudo snap alias dotnet-runtime-60.dotnet dotnet
  - dotnet tool install -g localappveyor

I get a “segmentation fault” bug:

e/travis/.travis/functions: line 109:  3145 Segmentation fault      dotnet tool install -g localappveyor

The command "dotnet tool install -g localappveyor" failed and exited with 139 during .

Thanks.

Error while parsing appveyor.yml

Z:\druntime>LocalAppVeyor lint --token=v2.dr7k***85kx
Validating 'Z:\druntime\appveyor.yml'...
Connecting to AppVeyor validation API...
YAML configuration file is valid.

Z:\druntime>LocalAppVeyor build
Error while parsing 'Z:\druntime\appveyor.yml' file. Build aborted.

(I don't know how to enable more verbose output)

This appveyor.yml file is here: https://github.com/dlang/druntime/blob/master/appveyor.yml
This is well-known project, most likely file is valid. It is not contains not supported build steps.

feature_request(enhancement): install missing software

1. Summary

It would be nice, if would be possible install software, that missed on current PC.

2. Argumentation

If:

  1. User want to create build not on usual working PC
  2. Or another user want to try install/build/test project with appveyor.yml

User machine can't have software, that pre-installed on AppVeyor. It would be nice, if would be possible simply add missing software.

3. Example of expected behavior

  • localappveyor.yml:
install:
  choco:
  - nodejs
  - git
  - ruby

User run a command:

LocalAppVeyor build --job 0 --install

Before AppVeyor steps will run file:

START /B CMD /C choco install nodejs --yes
START /B CMD /C choco install git --yes
START /B CMD /C choco install ruby --yes

Chocolatey will install parallel nodejs, git, rubynames of Chocolatey packages.

See choco install description for details.

Thanks.

BatchScriptExecutor Execute does not maintain state during directory changes

When testing the LocalAppVeyor using TinyFormat's appveyor file I noticed that cmake was never generating any of the files due to directory traversal

During the build_script block (below for reference), when it creates and moves to the new directory the directory change does not persist to the next step. This is because BatchScriptExecuter.Execute launches a new cmd window for each step, which causes the directory change to be lost.

build_script:
  - echo --------------------------------------------------------------------------------
  - echo Build tinyformat
  - mkdir build
  - cd build 
  - cmake -G "%COMPILER%" .. 
  - cmake --build . --config %CONFIGURATION%

Support `assembly_info` step

Format:

assembly_info:
  patch: true
  file: AssemblyInfo.*
  assembly_version: "2.2.{build}"
  assembly_file_version: "{version}"
  assembly_informational_version: "{version}"

Should support patching of both AssemblyInfo.cs and AssemblyInfo.vb files.

feature_request(enhancement): skip steps

1. Summary

It would be nice, if would be possible skip some steps of appveyor.yml file.

2. Argumentation

If user works on usual working PC:

    user don't need steps init and install. User already all initialize and install. These steps take a lot of user time for big projects.

3. Example of expected behavior

  • localappveyor.yml
skip:
- init
- install

User run:

LocalAppVeyor build --job 0 --skip

init and install steps will skip; init and install scripts will not run.

4. Examples on other apps

wwtd — Travis CI local builds runner — can skip install step.

Thanks.

Cannot install on NetCore 2.1

Command dotnet tool install --global localappveyor --version 0.5.0-alpha1 fails with error:

warning NU1603: LocalAppVeyor.Engine 0.5.0-alpha1 depends on System.Management.Automation (>= 1.0.0-alpha9) but System.Management.Automation 1.0.0-alpha9 was no
t found. An approximate best match of System.Management.Automation 6.1.7601.17514 was resolved.
warning NU1701: Package 'YamlDotNet 4.0.1-pre284' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version
=v2.1'. This package may not be fully compatible with your project.
error NU1212: Invalid project-package combination for LocalAppVeyor 0.5.0-alpha1. DotnetToolReference project style can only contain references of the DotnetToo
l type
The tool package could not be restored.
Tool 'localappveyor' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

LocalAppVeyor --help returns error

Installed netcore sdk form MS site.

Tell me what to do about it?

C:\Users\user>LocalAppVeyor --help
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.2.0' was not found.
  - The following frameworks were found:
      3.1.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.2.0&arch=x64&rid=win10-x64

Provided by LocalAppVeyor link says:

This release has reached end of life, meaning it is no longer supported. We recommend moving to a supported release, such as .NET Core 3.1 Runtime. See our support policy for more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.