Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Appveyor.jl

[![Build status](https://ci.appveyor.com/api/projects/status/rbca6b6qclxqdhwx/branch/version-1?svg=true)](https://ci.appveyor.com/project/simonbyrne/appveyor-jl)
[![codecov.io](http://codecov.io/github/JuliaCI/Appveyor.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaCI/Appveyor.jl?branch=master)
[![codecov.io](http://codecov.io/github/JuliaCI/Appveyor.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaCI/Appveyor.jl?branch=version-1)
[![Coveralls](https://coveralls.io/repos/github/JuliaCI/Appveyor.jl/badge.svg?branch=version-1)](https://coveralls.io/github/JuliaCI/Appveyor.jl?branch=version-1)

This contains a "universal" Appveyor script for Julia repositories, making it easier to set up matrix builds and keep URLs up-to-date.

Expand All @@ -15,6 +16,10 @@ environment:
- julia_version: 0.7
- julia_version: 1
- julia_version: nightly
# codecov: true
# coveralls_token:
# secure: XXXXX


platform:
- x86 # 32-bit
Expand Down Expand Up @@ -48,15 +53,33 @@ test_script:
- echo "%JL_TEST_SCRIPT%"
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"

# # Uncomment to support code coverage upload. Should only be enabled for packages
# # which would have coverage gaps without running on Windows
# on_success:
# - echo "%JL_CODECOV_SCRIPT%"
# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"
on_success:
- echo "%JL_SUCCESS_SCRIPT%"
- C:\julia\bin\julia -e "%JL_SUCCESS_SCRIPT%"
```

Adjust `julia_version` numbers as needed. Accepted are:
## Julia versions

Adjust `julia_version` environment variable as needed. Accepted are:
- `nightly`: for latest [nightly build](https://julialang.org/downloads/nightlies.html).
- `1`: for latest version 1 major release
- x.y: for latest x.y minor release
- x.y.z: for exact x.y.z release

## Coverage

The script supports automatic uploading of coverage statistics to various online services.

### Codecov

1. Enable [Codecov.io](https://codecov.io/) on the repository.
2. Add a `codecov` environment variable.

If the repository is private, you will need to provide a `CODECOV_TOKEN`, similar to Coveralls below.

### Coveralls

1. Enable [Coveralls.io](https://coveralls.io/) on the repository.
2. Copy the provided secret token.
3. Encrypt the token at https://ci.appveyor.com/tools/encrypt
4. Provide the encrypted token as a [secure environment variable](https://www.appveyor.com/docs/how-to/secure-files/#decrypting-files-during-an-appveyor-build) `coveralls_token` (see the example above).
7 changes: 5 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ environment:
- julia_version: 0.7.0
- julia_version: 1
- julia_version: nightly
codecov: true
coveralls_token:
secure: Qkud4b8Xxxi2QEM+hvq0xTOkk7kJG7ND2MDjdY/btOouq6jauYA9kCz60VHDtWRA

platform:
- x86
Expand Down Expand Up @@ -45,5 +48,5 @@ test_script:
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"

on_success:
- echo "%JL_CODECOV_SCRIPT%"
- C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"
- echo "%JL_SUCCESS_SCRIPT%"
- C:\julia\bin\julia -e "%JL_SUCCESS_SCRIPT%"
26 changes: 26 additions & 0 deletions bin/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,46 @@ if ($env:APPVEYOR_REPO_NAME -match "(\w+?)\/(\w+?)(?:\.jl)?$") {
$projectname = $matches[2]
}


# Coverage

$coverage = ""
if (Test-Path env:CODECOV -or Test-Path env:CODECOV_TOKEN) {
$coverage += "Codecov.submit(process_folder());"
}
if (Test-Path env:COVERALLS_TOKEN) {
$coverage += "Coveralls.submit(process_folder());"
}

if ($julia_version -ge [Version]"0.7") {
if (Test-Path "Project.toml") {
$env:JULIA_PROJECT = "@." # TODO: change this to --project="@."
$env:JL_BUILD_SCRIPT = "using Pkg; Pkg.build()"
$env:JL_TEST_SCRIPT = "using Pkg; Pkg.test(coverage=true)"
$env:JL_SUCCESS_SCRIPT = "using Pkg;"
if ($coverage -ne "") {
$env:JL_SUCCESS_SCRIPT += "Pkg.add(\`"Coverage\`"); using Coverage; $coverage"
}
# to be removed in next iteration
$env:JL_CODECOV_SCRIPT = "using Pkg; Pkg.add(\`"Coverage\`"); using Coverage; Codecov.submit(process_folder())"
} else {
$env:JL_BUILD_SCRIPT = "using Pkg; Pkg.clone(pwd(), \`"$projectname\`"); Pkg.build(\`"$projectname\`")"
$env:JL_TEST_SCRIPT = "using Pkg; Pkg.test(\`"$projectname\`", coverage=true)"
$env:JL_SUCCESS_SCRIPT = "using Pkg;"
if ($coverage -ne "") {
$env:JL_SUCCESS_SCRIPT += "cd(Pkg.dir(\`"$projectname\`")); Pkg.add(\`"Coverage\`"); using Coverage; $coverage"
}
# to be removed in next iteration
$env:JL_CODECOV_SCRIPT = "using Pkg; cd(Pkg.dir(\`"$projectname\`")); Pkg.add(\`"Coverage\`"); using Coverage; Codecov.submit(process_folder())"
}
} else {
$env:JL_BUILD_SCRIPT = "Pkg.clone(pwd(), \`"$projectname\`"); Pkg.build(\`"$projectname\`")"
$env:JL_TEST_SCRIPT = "Pkg.test(\`"$projectname\`", coverage=true)"
$env:JL_SUCCESS_SCRIPT = ""
if ($coverage -ne "") {
$env:JL_SUCCESS_SCRIPT += "cd(Pkg.dir(\`"$projectname\`")); Pkg.add(\`"Coverage\`"); using Coverage; $coverage"
}
# to be removed in next iteration
$env:JL_CODECOV_SCRIPT = "cd(Pkg.dir(\`"$projectname\`")); Pkg.add(\`"Coverage\`"); using Coverage; Codecov.submit(process_folder())"
}

Expand Down