Use literal block style for multi-line YAML

Allows for Julia code to not require the use of semi-colon which is
matches how most users will write Julia code. An additional benefit
is that it allows for use of single line comments.
This commit is contained in:
Curtis Vogt 2020-01-23 15:03:11 -06:00
parent ab9949a236
commit e258aacd7a
10 changed files with 103 additions and 86 deletions

View File

@ -12,7 +12,7 @@ julia:
before_script:
- git config --global user.name Tester
- git config --global user.email te@st.er
script: travis_wait julia --project -e 'using Pkg; Pkg.test(; coverage=true)'
script: travis_wait julia --project -e 'using Pkg; Pkg.test(coverage=true)'
matrix:
fast_finish: true
allow_failures:
@ -26,14 +26,16 @@ matrix:
- git config --global user.name name
- git config --global user.email email
- git config --global github.user username
- julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(; path=pwd()));
Pkg.instantiate();
include("docs/make.jl");'
- |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
include("docs/make.jl")'
after_success: skip
after_success: julia -e '
using Pkg;
Pkg.add("Coverage");
using Coverage;
Codecov.submit(process_folder());'
after_success: |
julia -e '
using Pkg
Pkg.add("Coverage")
using Coverage
Codecov.submit(process_folder())'

View File

@ -57,10 +57,11 @@ jobs:
- uses: julia-actions/setup-julia@v1
with:
version: '1.0'
- run: julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(; path=pwd()));
Pkg.instantiate();'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,21 +1,23 @@
.definitions:
script: &script
script:
- julia --project=@. -e '
using Pkg;
Pkg.build();
Pkg.test({{#HAS_COVERAGE}}; coverage=true{{/HAS_COVERAGE}});'
- |
julia --project=@. -e '
using Pkg
Pkg.build()
Pkg.test({{#HAS_COVERAGE}}coverage=true{{/HAS_COVERAGE}})'
{{#HAS_COVERAGE}}
coverage: &coverage
coverage: /Test coverage (\d+\.\d+%)/
after_script:
- julia -e '
using Pkg;
Pkg.add("Coverage");
using Coverage;
c, t = get_summary(process_folder());
using Printf;
@printf "Test coverage %.2f%%\n" 100c / t;'
- |
julia -e '
using Pkg
Pkg.add("Coverage")
using Coverage
c, t = get_summary(process_folder())
using Printf
@printf "Test coverage %.2f%%\n" 100c / t'
{{/HAS_COVERAGE}}
{{#VERSIONS}}
Julia {{{.}}}:
@ -30,11 +32,12 @@ pages:
image: julia:{{{VERSION}}}
stage: deploy
script:
- julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(; path=pwd()));
Pkg.instantiate();
include("docs/make.jl");'
- |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
include("docs/make.jl")'
- mkdir -p public
- mv docs/build public/dev
artifacts:

View File

@ -38,27 +38,30 @@ jobs:
include:
- stage: Documentation
julia: {{{VERSION}}}
script: julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(; path=pwd()));
Pkg.instantiate();
include("docs/make.jl");'
script: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
include("docs/make.jl")'
after_success: skip
{{/HAS_DOCUMENTER}}
{{#HAS_COVERAGE}}
after_success:
{{#HAS_CODECOV}}
- julia -e '
using Pkg;
Pkg.add("Coverage");
using Coverage;
Codecov.submit(process_folder());'
- |
julia -e '
using Pkg
Pkg.add("Coverage")
using Coverage
Codecov.submit(process_folder())'
{{/HAS_CODECOV}}
{{#HAS_COVERALLS}}
- julia -e '
using Pkg;
Pkg.add("Coverage");
using Coverage;
Coveralls.submit(process_folder());'
- |
julia -e '
using Pkg
Pkg.add("Coverage")
using Coverage
Coveralls.submit(process_folder())'
{{/HAS_COVERALLS}}
{{/HAS_COVERAGE}}

View File

@ -1,20 +1,22 @@
.definitions:
script: &script
script:
- julia --project=@. -e '
using Pkg;
Pkg.build();
Pkg.test(; coverage=true);'
- |
julia --project=@. -e '
using Pkg
Pkg.build()
Pkg.test(coverage=true)'
coverage: &coverage
coverage: /Test coverage (\d+\.\d+%)/
after_script:
- julia -e '
using Pkg;
Pkg.add("Coverage");
using Coverage;
c, t = get_summary(process_folder());
using Printf;
@printf "Test coverage %.2f%%\n" 100c / t;'
- |
julia -e '
using Pkg
Pkg.add("Coverage")
using Coverage
c, t = get_summary(process_folder())
using Printf
@printf "Test coverage %.2f%%\n" 100c / t'
Julia 1.0:
image: julia:1.0
<<: *script

View File

@ -17,13 +17,15 @@ jobs:
allow_failures:
- julia: nightly
after_success:
- julia -e '
using Pkg;
Pkg.add("Coverage");
using Coverage;
Codecov.submit(process_folder());'
- julia -e '
using Pkg;
Pkg.add("Coverage");
using Coverage;
Coveralls.submit(process_folder());'
- |
julia -e '
using Pkg
Pkg.add("Coverage")
using Coverage
Codecov.submit(process_folder())'
- |
julia -e '
using Pkg
Pkg.add("Coverage")
using Coverage
Coveralls.submit(process_folder())'

View File

@ -34,10 +34,11 @@ jobs:
- uses: julia-actions/setup-julia@v1
with:
version: '1.0'
- run: julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(; path=pwd()));
Pkg.instantiate();'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -19,9 +19,10 @@ jobs:
include:
- stage: Documentation
julia: 1.0
script: julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(; path=pwd()));
Pkg.instantiate();
include("docs/make.jl");'
script: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
include("docs/make.jl")'
after_success: skip

View File

@ -1,10 +1,11 @@
.definitions:
script: &script
script:
- julia --project=@. -e '
using Pkg;
Pkg.build();
Pkg.test();'
- |
julia --project=@. -e '
using Pkg
Pkg.build()
Pkg.test()'
Julia 0.6:
image: julia:0.6
<<: *script
@ -15,11 +16,12 @@ pages:
image: julia:1.2
stage: deploy
script:
- julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(; path=pwd()));
Pkg.instantiate();
include("docs/make.jl");'
- |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
include("docs/make.jl")'
- mkdir -p public
- mv docs/build public/dev
artifacts:

View File

@ -56,7 +56,7 @@ uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "0.3.10"
[[Pkg]]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Test", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
[[Printf]]