tkf / Run.jl

MIT License
19 stars 0 forks source link

Run

Stable Dev Build Status Codecov Coveralls GitHub last commit

Run.jl provides functions to run tests or build documentation in an isolated environment. See more in the documentation.

Features

Examples

.github/workflow/*.yml

Here is an example for using Run.jl with GitHub Actions. Create a file, e.g., .github/workflow/test.yml, with:

name: Run tests

on:
  push:
    branches:
      - master
    tags: '*'
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        julia-version: ['1']
      fail-fast: false
    name: Test Julia ${{ matrix.julia-version }}
    steps:
      - uses: actions/checkout@v2
      - name: Setup julia
        uses: julia-actions/setup-julia@v1
        with:
          version: ${{ matrix.julia-version }}
      - run: julia -e 'using Pkg; pkg"add Run@0.1"'
      - run: julia -e 'using Run; Run.prepare_test()'
      - run: julia -e 'using Run; Run.test()'
      - uses: julia-actions/julia-processcoverage@v1
      - uses: codecov/codecov-action@v1
        with:
          file: ./lcov.info
          flags: unittests
          name: codecov-umbrella

.travis.yml

To use Run.test to run tests in Travis CI, add the following snippet in .travis.yml.

before_install:
  - unset JULIA_PROJECT
  - julia -e 'using Pkg; pkg"add Run@0.1"'
install:
  - julia -e 'using Run; Run.prepare_test()'
script:
  - julia -e 'using Run; Run.test()'
after_success:
  - julia -e 'using Run; Run.after_success_test()'
jobs:
  include:
    - stage: Documentation
      install:
        - julia -e 'using Run; Run.prepare_docs()'
      script:
        - julia -e 'using Run; Run.docs()'
      after_success: skip

Side notes:

.gitlab-ci.yml

.template:
  image: julia
  before_script:
    - julia -e 'using Pkg; pkg"add Run@0.1"'

test:
  extends: .template
  script:
    - julia -e 'using Run; Run.test()'

pages:
  extends: .template
  stage: deploy
  script:
    - julia -e 'using Run; Run.docs()'
    - mv docs/build public
  artifacts:
    paths:
      - public
  only:
    - master