environment:
  matrix:
  # - julia_version: "1.6"
  #   JULIA_PKG_SERVER: ""
  # - julia_version: "1.6"
  #   JULIA_PKG_SERVER: "pkg.julialang.org"
  - julia_version: "nightly"
    JULIA_PKG_SERVER: "pkg.julialang.org"

platform:
  - x64 # 64-bit

# # Uncomment the following lines to allow failures on nightly julia
# # (tests will run but not make your overall status red)
# matrix:
#   allow_failures:
#   - julia_version: latest

branches:
  only:
    - master
    - /^release-.*/
    - /^v[0-9]+\.[0-9]+\.[0-9]+$/ # version tags

notifications:
  - provider: Email
    on_build_success: false
    on_build_failure: false
    on_build_status_changed: false

install:
  - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))

build_script:
  - C:\julia\bin\julia -e "using InteractiveUtils; versioninfo();
      using UUIDs;
      before = read(\"Project.toml\", String);
      after = replace(before, \"uuid = \\\"44cfe95a-1eb2-52ea-b672-e2afdf69b78f\\\"\" =>
                              \"uuid = \\\"54cfe95a-1eb2-52ea-b672-e2afdf69b78f\\\"\");
      write(\"Project.toml\", after);
      import Pkg; Pkg.build()"

test_script:
  - echo "%JL_TEST_SCRIPT%"
  - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"

# on_success:
#   - C:\julia\bin\julia --project=test/coverage -e "using Pkg; Pkg.instantiate(); using Coverage; Codecov.submit(Codecov.process_folder())"
