Git Product home page Git Product logo

actions's Introduction

GitHub Actions for Building and Testing PowerShell modules

I'm working on some actions for myself, but figured I'd put them here where others can use them.

They are currently very much a work in progress, not documented, and the Pester step in particular isn't fully working. Also, because they're all packaged together like this, I'm not versioning them very well for now, so when there are breaking changes, it won't be very clear which task changed.

For an example of how to use these, see my Configuration module.

Build-Module

This one's a simple wrapper for ModuleBuilder to call Build-Module on every build.psd1 in your repository.

Note that this requires you to write the build.psd1 manifest with appropriate values.

GitVersion

A simple cross-platform wrapper for GitVersion which caches the binary and runs gitversion in your repo. All the GitVersion Output Variables are exposed on the output of the action.

Note that you should already have a gitversion.yml in your repository for this to work well.

Install-RequiredModules

This is a wrapper for my RequiredModules installer, which handles installing (and optionally, importing) specific versions of modules for build processes. Although this task is here, several of my other tasks use Install-RequiredModules.ps1 as their way of ensuring the modules they need are present.

To use this, you will need a RequiredModules.psd1 in your repository. It does not support specifying your dependencies as inputs.

Pester

This is a simple wrapper for Pester which supports Gherkin (if you specify a version of Pester that includes it, like 4.10.1 but not 5.x) and outputs a results.xml and (optionally) coverage.xml

Currently, this doesn't really handle the test results, and does not publish the two output xml files. It fails if pester fails, but there's no test reports or code coverage report or any of that yet. You'll want to add a step to capture this output like:

- name: Upload Results
  uses: actions/upload-artifact@v2
  with:
    name: Pester Results
    path: ${{github.workspace}}/*.xml

actions's People

Contributors

bravo-kernel avatar jaykul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

actions's Issues

gitversion task failing on verbose output

This is the exact issue here: cake-build/cake#3274

When a branch matches multiple branch configs in gitversion.yml, gitversion.exe will write verbose output along with the gitversion string, which causes ConvertFrom-Json to fail.

I've fixed my gitversion.yml, but it would be an easy fix (?) to add -verbosity Quiet to the gitversion command.

PS C:\Users\curle\BicepDev> gitversion

Multiple branch configurations match the current branch branchName of 'pull/test'. Using the first matching configuration, 'pull-request'. Matching configurations include:'
 - pull-request
 - feature'
Multiple branch configurations match the current branch branchName of 'pull/test'. Using the first matching configuration, 'pull-request'. Matching configurations include:'
 - pull-request
 - feature'
Multiple branch configurations match the current branch branchName of 'pull/test'. Using the first matching configuration, 'pull-request'. Matching configurations include:'
 - pull-request
 - feature'
{
  "Major": 1,
  "Minor": 0,
  "Patch": 4,
  "PreReleaseTag": "rc.8",
  "PreReleaseTagWithDash": "-rc.8",
  "PreReleaseLabel": "rc",
  "PreReleaseLabelWithDash": "-rc",
  "PreReleaseNumber": 8,
  "WeightedPreReleaseNumber": 30008,
  "BuildMetaData": null,
  "BuildMetaDataPadded": "",
  "FullBuildMetaData": "Branch.pull-test.Sha.b6d672e8edc7c55969c28cec916dc0b058c81753",
  "MajorMinorPatch": "1.0.4",
  "SemVer": "1.0.4-rc.8",
  "LegacySemVer": "1.0.4-rc8",
  "LegacySemVerPadded": "1.0.4-rc0008",
  "AssemblySemVer": "1.0.4.0",
  "AssemblySemFileVer": "1.0.4.0",
  "FullSemVer": "1.0.4-rc.8",
  "InformationalVersion": "1.0.4-rc0008+Build.0.Date.20220129T202217.Branch.unknown.Sha.b6d672e8edc7c55969c28cec916dc0b058c81753",
  "BranchName": "pull/test",
  "EscapedBranchName": "pull-test",
  "Sha": "b6d672e8edc7c55969c28cec916dc0b058c81753",
  "ShortSha": "b6d672e",
  "NuGetVersionV2": "1.0.4-rc0008",
  "NuGetVersion": "1.0.4-rc0008",
  "NuGetPreReleaseTagV2": "rc0008",
  "NuGetPreReleaseTag": "rc0008",
  "VersionSourceSha": "23e8f7966b15186bc77931eea0c0e03b0fd67c3a",
  "CommitsSinceVersionSource": 8,
  "CommitsSinceVersionSourcePadded": "0008",
  "UncommittedChanges": 0,
  "CommitDate": "20220129T202217"
}

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.