From c3decb9d1dbd87cc7f5a7b0344fb2316de9594bd Mon Sep 17 00:00:00 2001 From: jakebolewski Date: Fri, 19 Jun 2020 14:18:40 -0600 Subject: [PATCH] Switch CI to use Github Actions --- .appveyor.yml | 47 ----------- .github/workflows/Tests.yml | 140 +++++++++++++++++++++++++++++++++ .github/workflows/dockerci.yml | 38 --------- .travis.yml | 43 ---------- Dockerfile | 6 -- Manifest.toml | 3 +- Project.toml | 1 + README.md | 9 --- bors.toml | 8 +- 9 files changed, 148 insertions(+), 147 deletions(-) delete mode 100644 .appveyor.yml create mode 100644 .github/workflows/Tests.yml delete mode 100644 .github/workflows/dockerci.yml delete mode 100644 .travis.yml delete mode 100644 Dockerfile diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index bd2fade61..000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,47 +0,0 @@ -branches: - only: - # This is where pull requests from "bors r+" are built. - - staging - # This is where pull requests from "bors try" are built. - - trying - # Enable building pull requests. - - master - -environment: - PYTHON: conda - matrix: - - julia_version: 1.3 - - julia_version: nightly - -platform: - - x86 # 32-bit - - 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: nightly - -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: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" - -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%" diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml new file mode 100644 index 000000000..0b12ddd68 --- /dev/null +++ b/.github/workflows/Tests.yml @@ -0,0 +1,140 @@ +name: Tests + +on: + pull_request: + push: + branches: + - staging + - trying +jobs: + test-linux: + timeout-minutes: 60 + strategy: + fail-fast: true + + runs-on: ubuntu-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.4.0 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v2.2.0 + + - name: Set up Julia + uses: julia-actions/setup-julia@v1.1.6 + with: + version: 1.4 + + - name: Install Julia Project Packages + # we add this ENV varaible to force PyCall to download and use Conda rather than + # the system python (default on Linux), see the PyCall documentation + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Pkg; Pkg.instantiate()' + + - name: Install SciKitLearn Conda Package + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Conda; Conda.add("scikit-learn")' + + - name: Run Unit Tests + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Pkg; Pkg.test(coverage=true)' + + - name: Generate coverage file + run: | + julia --project=@. -e 'using Pkg; Pkg.add("Coverage"); + using Coverage; + LCOV.writefile("coverage-lcov.info", Codecov.process_folder())' + if: success() + + - name: Submit coverage + uses: codecov/codecov-action@v1.0.7 + with: + token: ${{secrets.CODECOV_TOKEN}} + if: success() + + test-macos: + timeout-minutes: 60 + strategy: + fail-fast: true + + runs-on: macos-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.4.0 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v2.2.0 + + - name: Set up Julia + uses: julia-actions/setup-julia@v1.1.6 + with: + version: 1.4 + + - name: Install Julia Project Packages + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Pkg; Pkg.instantiate()' + + - name: Install SciKitLearn Conda Package + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Conda; Conda.add("scikit-learn")' + + - name: Run Unit Tests + env: + PYTHON: "" + run: | + LD_LIBRARY_PATH=$HOME/.julia/conda/3/lib julia --project=@. -e 'using Pkg; Pkg.test()' + + test-windows: + timeout-minutes: 60 + strategy: + fail-fast: true + + runs-on: windows-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.4.0 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v2.2.0 + + - name: Set up Julia + uses: julia-actions/setup-julia@v1.1.6 + with: + version: 1.4 + + - name: Install Julia Project Packages + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Pkg; Pkg.instantiate()' + + - name: Install SciKitLearn Conda Package + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Conda; Conda.add(\"scikit-learn\")' + + - name: Run Unit Tests + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Pkg; Pkg.test()' diff --git a/.github/workflows/dockerci.yml b/.github/workflows/dockerci.yml deleted file mode 100644 index ba3e35b4e..000000000 --- a/.github/workflows/dockerci.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: DockerCI - -on: - push: - branches: [ master, staging, trying ] - pull_request: - branches: [ master, staging, trying ] - -jobs: - dockerci: - runs-on: ${{ matrix.os }} - strategy: - matrix: - julia-version: [1.3, 1.4] - os: [ubuntu-latest] - - steps: - - uses: actions/checkout@v2 - - name: Build and test - run: | - docker build . --file Dockerfile --tag ces:PR - docker images - docker run ces:PR - - name: "Generate coverage" - env: - JULIA_PROJECT: "@." - run: julia --project=@. -e 'using Pkg; - cd(Pkg.dir("CalibrateEmulateSample")); - Pkg.add("Coverage"); - using Coverage; - LCOV.writefile("coverage-lcov.info", Codecov.process_folder())' - if: success() - - name: "Submit coverage" - uses: codecov/codecov-action@v1.0.2 - with: - token: ${{secrets.CODECOV_TOKEN}} - if: success() - diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 534cf174e..000000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -branches: - only: - # This is where pull requests from "bors r+" are built. - - staging - # This is where pull requests from "bors try" are built. - - trying - # Enable building pull requests. - - master - -## Documentation: http://docs.travis-ci.com/user/languages/julia/ -language: julia -sudo: true -dist: xenial -os: - - linux - - osx -julia: - - 1.3 - -notifications: - email: false - -after_success: - # push coverage results to Codecov - - julia -e 'import Pkg; - cd(Pkg.dir("CalibrateEmulateSample")); - Pkg.add("Coverage"); - using Coverage; - Codecov.submit(Codecov.process_folder())' - -jobs: - include: - - stage: "Documentation" - julia: 1.3 - os: linux - script: - - export DOCUMENTER_DEBUG="true" - - julia --color=yes --project=docs/ -e 'using Pkg; - Pkg.develop(PackageSpec(path=pwd())); - Pkg.instantiate(); - Pkg.build("CalibrateEmulateSample")' - - julia --color=yes --project=docs/ docs/make.jl - after_success: skip diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 61b17ded6..000000000 --- a/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM julia:1.3 - -COPY . /CalibrateEmulateSample.jl/ - -WORKDIR /CalibrateEmulateSample.jl/ -RUN julia --project -e "using Pkg; Pkg.instantiate();" diff --git a/Manifest.toml b/Manifest.toml index 0a68fe3fb..e7eee69e8 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -481,6 +481,7 @@ uuid = "1d6d02ad-be62-4b6b-8a6d-2f90e265016e" version = "0.1.2" [[LibGit2]] +deps = ["Printf"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[Libdl]] @@ -657,7 +658,7 @@ uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" version = "1.0.5" [[Pkg]] -deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Test", "UUIDs"] +deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [[PoissonRandom]] diff --git a/Project.toml b/Project.toml index 974dceca0..06c35bf68 100644 --- a/Project.toml +++ b/Project.toml @@ -5,6 +5,7 @@ version = "0.1.0" [deps] Cloudy = "9e3b23bb-e7cc-4b94-886c-65de2234ba87" +Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d" DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" diff --git a/README.md b/README.md index b9853001b..ea6d8c1af 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,6 @@ [docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg [docs-dev-url]: https://CliMA.github.io/CalibrateEmulateSample.jl/dev/ -[travis-img]: https://travis-ci.org/CliMA/CalibrateEmulateSample.jl.svg?branch=master -[travis-url]: https://travis-ci.org/CliMA/CalibrateEmulateSample.jl - -[appveyor-img]: https://ci.appveyor.com/api/projects/status/c6eykd0w94pmyjt8/branch/master?svg=true -[appveyor-url]: https://ci.appveyor.com/project/climate-machine/calibrateemulatesample-jl/branch/master - -[docker-ci-img]: https://github.com/CliMA/CalibrateEmulateSample.jl/workflows/DockerCI/badge.svg -[docker-ci-url]: https://github.com/CliMA/CalibrateEmulateSample.jl/actions - [codecov-img]: https://codecov.io/gh/CliMA/CalibrateEmulateSample.jl/branch/master/graph/badge.svg [codecov-url]: https://codecov.io/gh/CliMA/CalibrateEmulateSample.jl diff --git a/bors.toml b/bors.toml index c532236c1..9aa10a946 100644 --- a/bors.toml +++ b/bors.toml @@ -1,6 +1,8 @@ status = [ - "dockerci (1.4, ubuntu-latest)", + 'test-linux', + 'test-macos', + 'test-windows' ] delete_merged_branches = true -timeout_sec = 86400 -block_labels = [ "do-not-merge-yet" ] \ No newline at end of file +timeout_sec = 3600 +block_labels = [ "do-not-merge-yet" ]