Skip to content

Commit

Permalink
Switch to github actions (#408)
Browse files Browse the repository at this point in the history
* Switch to github actions

* sudo for apt install

* Separate nightly and add badge

* Remove doctest from nightly file

* Move ci to same file and remove apt from test

* Remove nightly file

* Update job names

* Split test and docs in two files

* Add documenter key to tagbot

* Combine versions, run coverage on v1

* Quote v1.0 so it is not same as v1

* Testing doc commands

* move doctest to test

* add apt needed for doctest to test

* change test jobname, try to fix weird bug

* move doctest to Docs

* Fix imports for docs workflow

* remove explicit doctest call, makedocs includes it

* Fix badges for test

* rename workflows

* doctest in runtest

* add apt install to ci test

* add timeout of 30 minutes

* Set StaticArrays compat to 1.0 and update doctest

* Bind StaticArrays dep to 0.12 for julia 1.0

* Update test badge to point to correct workflow

* Remove StaticArrays restriction, test on julia 1.3

* Move back to test 1.0 with StaticArrays 0.12

* Remove unused DOCUMENTER_KEY

* Fix badge link

* Fix badge link (again...)

* Remove StaticArrays compat, move doctest

* Keep compat in docs

* Remove extra citation

* remove docs apt deps from ci

* add envvars for plots to doctest

* Remove StaticArrays from test deps

* Move ENV setup for docs

* Revert "Move ENV setup for docs"

This reverts commit d49c1a2.

* increase timeout limit for ci and docs

* Add badge for doc status

* Documentation -> Docs in actions

* Reduce CI timeout time

* add newline between badges

* Add strict check for docs, remove double doctest

* Run doctest twice until we figure out strict kw
  • Loading branch information
albheim authored Jan 16, 2021
1 parent 6c54a25 commit ca6cc80
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 54 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Docs

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

jobs:
docs:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
version: [1]
os: [ubuntu-latest]
arch: [x64]
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- name: Install apt deps
run: sudo apt-get install libgtk-3-dev dvipng texlive
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Setup docs environment
run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- name: Test docs # Test are also run in the makedocs, but there they don't error properly unless we set strict in which case warnings also error
run: |
julia --project=docs -e '
ENV["PLOTS_TEST"] = "true"
ENV["GKSwstype"] = "nul"
using Documenter: doctest
using ControlSystems
doctest(ControlSystems)'
- name: Generate documentation
run: julia --project=docs --color=yes docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

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

jobs:
runtests:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }} # Allow nightly to fail and workflow still count as completed
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
version: ['1.0', '1', 'nightly']
os: [ubuntu-latest]
arch: [x64]
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
if: ${{ matrix.version == '1' }}
- uses: codecov/codecov-action@v1
if: ${{ matrix.version == '1' }}
with:
file: lcov.info
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ julia = "1.0"

[extras]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Documenter", "GR", "StaticArrays"]
test = ["Test", "Documenter", "GR"]
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ControlSystems.jl

[![Build Status](https://travis-ci.com/JuliaControl/ControlSystems.jl.svg?branch=master)](https://travis-ci.com/JuliaControl/ControlSystems.jl)
[![Build Status](https://github.com/JuliaControl/ControlSystems.jl/workflows/CI/badge.svg)](https://github.com/JuliaControl/ControlSystems.jl/actions?query=workflow%3ACI)
[![Documentation Status](https://github.com/JuliaControl/ControlSystems.jl/workflows/Docs/badge.svg)](https://github.com/JuliaControl/ControlSystems.jl/actions?query=workflow%3ADocs)

[![PkgEval](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/C/ControlSystems.svg)](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/report.html)
[![codecov](https://codecov.io/gh/JuliaControl/ControlSystems.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaControl/ControlSystems.jl)

Expand Down
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
StaticArrays = "0.12"
7 changes: 4 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Set plot globals
ENV["PLOTS_TEST"] = "true"
ENV["GKSwstype"] = "100"
ENV["GKSwstype"] = "nul"

using Documenter, ControlSystems, Plots, LinearAlgebra, DSP
import GR # Bug with world age in Plots.jl, see https://github.com/JuliaPlots/Plots.jl/issues/1047
#import GR # Bug with world age in Plots.jl, see https://github.com/JuliaPlots/Plots.jl/issues/1047
gr()
default(show=false, size=(800,450))

Expand All @@ -30,6 +30,7 @@ println("Making docs")
makedocs(modules=[ControlSystems],
format=Documenter.HTML(),
sitename="ControlSystems.jl",
#strict=true,
pages=[
"Home" => "index.md",
"Guide" => Any[
Expand All @@ -47,6 +48,6 @@ makedocs(modules=[ControlSystems],
"Plotting" => "lib/plotting.md",
],
]
)
)

deploydocs(repo = "github.com/JuliaControl/ControlSystems.jl.git")
7 changes: 0 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using ControlSystems
using Test, LinearAlgebra, Random
using Documenter # For doctests
import Base.isapprox # In framework and test_synthesis
import SparseArrays: sparse # In test_matrix_comps
import DSP: conv # In test_conversion and test_synthesis
Expand Down Expand Up @@ -39,10 +38,4 @@ my_tests = [
_t0 = time()
run_tests(my_tests)
println("Ran all code tests in $(round(time()-_t0, digits=2)) seconds")


println("Test Doctests")
_t0 = time()
doctest(ControlSystems)
println("Ran Doctests in $(round(time()-_t0, digits=2)) seconds")
end
2 changes: 1 addition & 1 deletion test/test_plots.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set plot globals
ENV["PLOTS_TEST"] = "true"
ENV["GKSwstype"] = "100"
ENV["GKSwstype"] = "nul"

using Plots
gr()
Expand Down

0 comments on commit ca6cc80

Please sign in to comment.