Giter Club home page Giter Club logo

julia-detect-dependabot's Introduction

julia-detect-dependabot Action

Please note: This action is not registered in the marketplace and is experimental. You can still use it in your own workflows by referencing it as angusmoore/julia-detect-dependabot@main. But please treat as experimental for now.

This action checks if the current branch that the action is running on is a CompatHelper or dependabot branch. If so, it sets an output variable is_dependabot that you can check in subsequent steps.

the julia-actions/julia-runtest action does this automatically when running tests. If you are using julia-runtest, you do not need this action.

This action is helpful if you are manually invoking Pkg.test() but want to be able to easily set force_latest_compatible_version on CompatHelper pull requests (as is now standard for julia-runtest. This situation might arise because you need to pass in custom arguments, or flags to the julia process that are not supported by julia-runtest.

See also these issues [1] [2] for discussion of automatically setting force_latest_compatible_version automatically in CI scrits, which this action tries to solve (specifically this is row 2 in [1]).

Usage

Julia needs to be installed before this action can run. This can easily be achieved with the setup-julia action.

You need to provide an id for the action, so that you can access the output variable is_dependabot in subsequent github actions steps.

You can access the result is_dependabot (which is a string of either "true" or "false") using the github actions steps context. Eg, if you set the id for the julia-detect-dependabot action as dependabot, you would access the value in subsequent steps as: ${{ steps.dependabot.outputs.is_dependabot }}

An example workflow that uses this action might look like this:

name: Run tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        julia-version: ['1', 'nightly']
        julia-arch: [x64, x86]
        os: [ubuntu-latest]

    steps:
      - uses: actions/checkout@v2
      - uses: julia-actions/setup-julia@v1
        with:
          version: ${{ matrix.julia-version }}
          arch: ${{ matrix.julia-arch }}
      - uses: angusmoore/julia-detect-dependabot@main
        id: dependabot
      - name: Custom package tests
        run: |
            julia --project -e 'import Pkg; Pkg.test(; force_latest_compatible_version = parse(Bool, ENV["IS_DEPENDABOT"]))'
        env:
          is_dependabot: ${{ steps.dependabot.outputs.is_dependabot }}

julia-detect-dependabot's People

Contributors

angusmoore avatar

Watchers

 avatar  avatar

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.