Giter Club home page Giter Club logo

julia-runtest's Introduction

julia-runtest Action

This action runs the tests in a Julia package.

Usage

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

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

name: Run tests

on: 
  push:
    branches:
      - master
      - main
  pull_request:

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

    steps:
      - uses: actions/checkout@v2
      - uses: julia-actions/setup-julia@v1
        with:
          version: ${{ matrix.julia-version }}
          arch: ${{ matrix.julia-arch }}
      - uses: julia-actions/julia-buildpkg@v1
      - uses: julia-actions/julia-runtest@v1
        # with:
        #   annotate: true

You can add this workflow to your repository by placing it in a file called test.yml in the folder .github/workflows/. More info here.

Here, setting annotate: true causes GitHub "annotations" to appear when reviewing the PR, pointing to failing tests, if any. This functionality is only enabled on Julia 1.8 (even if annotate is set to true), since currently it does not work on other Julia versions (see #76).

By default, annotate is set to false, but that may change in future releases of this action.

Prefixing the Julia command

In some packages, you may want to prefix the julia command with another command, e.g. for running tests of certain graphical libraries with xvfb-run. In that case, you can add an input called prefix containing the command that will be inserted to your workflow:

      - uses: julia-actions/julia-runtest@v1
        with:
          prefix: xvfb-run

If you only want to add this prefix on certain builds, you can include additional values into a combination of your build matrix, e.g.:

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
        version: ['1.0', '1', 'nightly']
        arch: [x64]
        include:
          - os: ubuntu-latest
            prefix: xvfb-run
    steps:
    # ...
      - uses: julia-actions/julia-runtest@v1
        with:
          prefix: ${{ matrix.prefix }}
    # ...

This will add the prefix xvfb-run to all builds where the os is ubuntu-latest.

Suffixing the Julia command

In some packages, you may want to pass additional tests to the runtests.jl script. In that case, you can add an input called suffix containing the command that will be inserted after the runtests.jl script:

      - uses: julia-actions/julia-runtest@v1
        with:
          suffix: ["testarg1" "testarg2"]

Registry flavor preference

This actions defines (and exports for subsequent steps of the workflow) the environmental variable JULIA_PKG_SERVER_REGISTRY_PREFERENCE=eager unless it is already set. If you want another registry flavor (i.e. conservative) this should be defined in the env: section of the relevant workflow or step. See Registry flavors for more information.

julia-runtest's People

Contributors

anaveragehuman avatar beastyblacksmith avatar davidanthoff avatar dependabot-preview[bot] avatar dependabot[bot] avatar dilumaluthge avatar ericphanson avatar fonsp avatar fredrikekre avatar giordano avatar ianbutterworth avatar lkdvos avatar musm avatar odow avatar rikhuijzer avatar saschamann avatar tkf 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.