mirror of
https://github.com/julia-actions/julia-runtest.git
synced 2026-02-20 06:56:54 +08:00
allow passing multiple arguments in test_args (#118)
Co-authored-by: Markus Hauru <markus@mhauru.org> Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ed05f1e927
commit
df0572688c
20
README.md
20
README.md
@@ -91,7 +91,7 @@ This will add the prefix `xvfb-run` to all builds where the `os` is `ubuntu-late
|
||||
|
||||
You can pass arguments from the workflow specification to the test script via the `test_args` parameter.
|
||||
|
||||
This is useful, for example, to specify separate workflows for fast and slow tests.
|
||||
This is useful, for example, to specify separate workflows for fast and slow tests, or conditionally enabling quality assurance tests.
|
||||
|
||||
The functionality can be incorporated as follows:
|
||||
|
||||
@@ -101,7 +101,7 @@ The functionality can be incorporated as follows:
|
||||
# ...
|
||||
- uses: julia-actions/julia-runtest@v1
|
||||
with:
|
||||
test_args: 'only_fast_tests'
|
||||
test_args: 'slow_tests "quality assurance"'
|
||||
# ...
|
||||
```
|
||||
|
||||
@@ -111,11 +111,17 @@ The value of `test_args` can be accessed in `runtest.jl` via the `ARGS` variable
|
||||
using Test
|
||||
# ...
|
||||
|
||||
if @isdefined(ARGS) && length(ARGS) > 0 && ARGS[1] == "only_fast_tests"
|
||||
# run only fast tests
|
||||
include("only_fast_tests.jl")
|
||||
else
|
||||
# do something else
|
||||
# run fast tests by default
|
||||
include("fast_tests.jl")
|
||||
|
||||
if "slow_tests" in ARGS
|
||||
# run slow tests
|
||||
include("slow_tests.jl")
|
||||
end
|
||||
|
||||
if "quality assurance" in ARGS
|
||||
# run quality assurance tests
|
||||
include("qa.jl")
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user