mirror of
https://github.com/julia-actions/julia-runtest.git
synced 2026-02-12 11:06:54 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79a7e10088 | ||
|
|
1aec431e02 | ||
|
|
4867b265f3 | ||
|
|
3378215696 |
16
README.md
16
README.md
@@ -38,13 +38,15 @@ jobs:
|
||||
arch: ${{ matrix.julia-arch }}
|
||||
- uses: julia-actions/julia-buildpkg@v1
|
||||
- uses: julia-actions/julia-runtest@v1
|
||||
with:
|
||||
annotate: true
|
||||
# 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](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions).
|
||||
|
||||
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
|
||||
|
||||
@@ -78,3 +80,13 @@ If you only want to add this prefix on certain builds, you can [include addition
|
||||
```
|
||||
|
||||
This will add the prefix `xvfb-run` to all builds where the `os` is `ubuntu-latest`.
|
||||
|
||||
|
||||
### 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](https://pkgdocs.julialang.org/dev/registries/#Registry-flavors)
|
||||
for more information.
|
||||
|
||||
@@ -36,17 +36,19 @@ inputs:
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Set and export registry flavor preference
|
||||
run: echo "JULIA_PKG_SERVER_REGISTRY_PREFERENCE=${JULIA_PKG_SERVER_REGISTRY_PREFERENCE:-eager}" >> ${GITHUB_ENV}
|
||||
shell: bash
|
||||
- name: Install dependencies in their own (shared) environment
|
||||
run: |
|
||||
if VERSION > v"1.8pre"
|
||||
# Functionality only currently works on a narrow range of Julia versions... see #76
|
||||
if v"1.8pre" < VERSION < v"1.9.0-beta3"
|
||||
using Pkg
|
||||
Pkg.activate("tests-logger-env"; shared=true)
|
||||
Pkg.add(Pkg.PackageSpec(name="GitHubActions", version="0.1"))
|
||||
end
|
||||
shell: julia --color=yes {0}
|
||||
if: inputs.annotate == 'true'
|
||||
env:
|
||||
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: "${{ env.JULIA_PKG_SERVER_REGISTRY_PREFERENCE == '' && 'eager' || env.JULIA_PKG_SERVER_REGISTRY_PREFERENCE }}"
|
||||
- run: |
|
||||
# The Julia command that will be executed
|
||||
julia_cmd=( julia --color=yes --depwarn=${{ inputs.depwarn }} --inline=${{ inputs.inline }} --project=${{ inputs.project }} -e 'include(joinpath(ENV["GITHUB_ACTION_PATH"], "test_harness.jl"))' )
|
||||
@@ -64,4 +66,3 @@ runs:
|
||||
COVERAGE: ${{ inputs.coverage }}
|
||||
FORCE_LATEST_COMPATIBLE_VERSION: ${{ inputs.force_latest_compatible_version }}
|
||||
CHECK_BOUNDS: ${{ inputs.check_bounds }}
|
||||
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: "${{ env.JULIA_PKG_SERVER_REGISTRY_PREFERENCE == '' && 'eager' || env.JULIA_PKG_SERVER_REGISTRY_PREFERENCE }}"
|
||||
|
||||
@@ -4,7 +4,7 @@ kwargs = Kwargs.kwargs(; coverage=ENV["COVERAGE"],
|
||||
force_latest_compatible_version=ENV["FORCE_LATEST_COMPATIBLE_VERSION"],
|
||||
julia_args=[string("--check-bounds=", ENV["CHECK_BOUNDS"])])
|
||||
|
||||
if parse(Bool, ENV["ANNOTATE"]) && VERSION > v"1.8pre"
|
||||
if parse(Bool, ENV["ANNOTATE"]) && v"1.8pre" < VERSION < v"1.9.0-beta3"
|
||||
push!(LOAD_PATH, "@tests-logger-env") # access dependencies
|
||||
using GitHubActions, Logging
|
||||
global_logger(GitHubActionsLogger())
|
||||
|
||||
Reference in New Issue
Block a user