Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Merge #1234
Browse files Browse the repository at this point in the history
1234: Switch CI to use Github Actions, run tests in parallel and fast fail when possible  r=jakebolewski a=jakebolewski

* Run subset on every push in parallel
* Kill jobs that fail quickly
* Kill stale jobs quickly upon new commits to a branch
* Run all OS unit tests only on bors try / bors merge
* Remove Azure Devops Pipelines

# Description

A clear and concise description of the code with usage.



Co-authored-by: jakebolewski <[email protected]>
  • Loading branch information
bors[bot] and jakebolewski authored Jun 13, 2020
2 parents 4a07b42 + c69ff9f commit cef6389
Show file tree
Hide file tree
Showing 17 changed files with 158 additions and 154 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/Coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ on:

jobs:
coverage:
runs-on: ubuntu-16.04
strategy:
matrix:
julia-version: ['1.4']
project: ['ClimateMachine.jl']
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
- uses: actions/[email protected]

- name: Set up Julia
uses: julia-actions/[email protected]
with:
version: ${{ matrix.julia-version }}
version: 1.4

- name: Test with coverage
env:
Expand All @@ -35,8 +32,9 @@ jobs:
using Coverage;
LCOV.writefile("coverage-lcov.info", Codecov.process_folder())'
if: success()

- name: Submit coverage
uses: codecov/[email protected].2
uses: codecov/[email protected].7
with:
token: ${{secrets.CODECOV_TOKEN}}
if: success()
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/Documenter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ on:
jobs:
docs-build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/[email protected]
- uses: julia-actions/[email protected]
with:
version: 1.4
- name: Install dependencies
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/JuliaFormatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ on:
jobs:
format:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/[email protected]
with:
fetch-depth: 0
- run: git fetch origin
- uses: julia-actions/setup-julia@latest
- uses: julia-actions/setup-julia@v1.1.6
with:
version: 1.4
- name: Apply JuliaFormatter
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/Linux-UnitTests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Unit Tests

on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: true
matrix:
test-modules: ["Arrays,Atmos,Common,Diagnostics,Driver,InputOutput,Utilities",
"Numerics/DGMethods",
"Numerics/Mesh",
"Numerics/ODESolvers",
"Numerics/SystemSolvers",
"Ocean"]

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/[email protected]

- name: Set up Julia
uses: julia-actions/[email protected]
with:
version: 1.4

- name: Install Project Packages
run: |
julia --project=@. -e 'using Pkg; Pkg.instantiate(); Pkg.build()'
- name: Run Unit Tests
env:
TEST_MODULES: ${{ matrix.test-modules }}
run: |
julia --project=@. -e 'using Pkg; Pkg.test(test_args=map(String, split(ENV["TEST_MODULES"], ",")))'
43 changes: 43 additions & 0 deletions .github/workflows/OS-UnitTests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: OS Unit Tests

on:
push:
branches:
- staging
- trying

jobs:
test-os:
timeout-minutes: 120
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/[email protected]

- name: Set up Julia
uses: julia-actions/[email protected]
with:
version: 1.4

- name: Install Project Packages
run: |
julia --project=@. -e 'using Pkg; Pkg.instantiate(); Pkg.build()'
- name: Build System Image
run: |
julia --project=@. .dev/systemimage/climate_machine_image.jl ClimateMachine.so true
- name: Run Unit Tests
run: |
julia --project=@. -J ClimateMachine.so -e 'using Pkg; Pkg.test()'
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ The Climate Machine is a new Earth system model that leverages recent advances i
[docs-latest-img]: https://img.shields.io/badge/docs-latest-blue.svg
[docs-latest-url]: https://CliMA.github.io/ClimateMachine.jl/latest/

[azure-img]: https://dev.azure.com/climate-machine/ClimateMachine.jl/_apis/build/status/azure-ci?branchName=master
[azure-url]: https://dev.azure.com/climate-machine/ClimateMachine.jl/_build

[codecov-img]: https://codecov.io/gh/CliMA/ClimateMachine.jl/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/CliMA/ClimateMachine.jl

Expand Down
110 changes: 0 additions & 110 deletions azure-pipelines.yml

This file was deleted.

4 changes: 3 additions & 1 deletion bors.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
status = [
"azure-ci",
"test-os (ubuntu-latest)",
"test-os (windows-latest)",
"test-os (macos-latest)",
"ci/slurmci",
"docs-build",
"format"
Expand Down
16 changes: 14 additions & 2 deletions docs/src/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,22 @@ integration (CI) system.

A `ClimateMachine` developer will look at your PR and provide feedback!

We use [`bors`](https://bors.tech/) to manage the `ClimateMachine` repo.
Currently a number of checks are run per commit for a given PR:

- `JuliaFormatter` checks if the PR is formatted with `.dev/climaformat.jl`
- `Documentation` rebuilds the documentation for the PR and checks if the docs are consistent and generate valid output.
- `Unit Tests` run subsets of the unit tests defined in `tests/`, `Pkg.test()`. The tests are run in parallel to ensure that they finish in a reasonable time. The tests only run the latest commit for a PR, branch and will kill any stale jobs on push. These tests are only run on linux (Ubuntu LTS).

We use [`bors`](https://bors.tech/) to manage merging PR's in the the `ClimateMachine` repo.
If you're a collaborator and have the necessary permissions, you can type
`bors try` in a comment on a PR to have some additional tests run on that
PR, or `bors r+` to try and merge the code.
PR, or `bors r+` to try and merge the code. Bors ensures that all tests
for a given PR always pass before merging into `master`.

Bors aggregates and checks the following test outputs:
- `Documentation` checks that the documentation correctly builds for the merged PR.
- `OS Unit Tests` checks that ClimateMachine.jl package unit tests can pass on every OS supported (linux, macOS, windows).
- `slurmci` runs more extensive testing on both CPU and GPU hardware using Caltech HPC cluster resources.

## Contributing Documentation

Expand Down
2 changes: 2 additions & 0 deletions slurmci-test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
#

cpu = [
{ file = "test/Numerics/DGMethods/advection_diffusion/advection_diffusion_model_1dimex_bgmres.jl", slurmargs = ["--ntasks=1"], args = [] },
{ file = "test/Numerics/DGMethods/advection_diffusion/pseudo1D_advection_diffusion.jl", slurmargs = ["--ntasks=3"], args = [] },
{ file = "test/Numerics/DGMethods/advection_diffusion/pseudo1D_advection_diffusion_1dimex.jl", slurmargs = ["--ntasks=3"], args = [] },
{ file = "test/Numerics/DGMethods/advection_diffusion/pseudo1D_advection_diffusion_mrigark_implicit.jl", slurmargs = ["--ntasks=3"], args = [] },
{ file = "test/Numerics/DGMethods/advection_diffusion/pseudo1D_heat_eqn.jl", slurmargs = ["--ntasks=3"], args = [] },
{ file = "test/Numerics/DGMethods/advection_diffusion/periodic_3D_hyperdiffusion.jl", slurmargs = ["--ntasks=3"], args = [] },
{ file = "test/Numerics/DGMethods/compressible_Navier_Stokes/ref_state.jl", slurmargs = ["--ntasks=1"], args = [] },
{ file = "test/Numerics/Mesh/mpi_connect_1d.jl", slurmargs = ["--ntasks=5"], args = [] },
{ file = "test/Numerics/Mesh/mpi_connect_sphere.jl", slurmargs = ["--ntasks=5"], args = [] },
{ file = "test/Numerics/Mesh/mpi_getpartition.jl", slurmargs = ["--ntasks=5"], args = [] },
Expand Down
6 changes: 4 additions & 2 deletions test/Atmos/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ using Test, Pkg
@testset "Atmos" begin
all_tests = isempty(ARGS) || "all" in ARGS ? true : false
for submodule in ["Parameterizations", "TemperatureProfiles"]
if all_tests || "$submodule" in ARGS || "Atmos" in ARGS
if all_tests ||
"$submodule" in ARGS ||
"Atmos/$submodule" in ARGS ||
"Atmos" in ARGS
include_test(submodule)
end
end

end
5 changes: 4 additions & 1 deletion test/Common/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ using Test, Pkg
@testset "Common" begin
all_tests = isempty(ARGS) || "all" in ARGS ? true : false
for submodule in ["Thermodynamics", "SurfaceFluxes"]
if all_tests || "$submodule" in ARGS || "Common" in ARGS
if all_tests ||
"$submodule" in ARGS ||
"Common/$submodule" in ARGS ||
"Common" in ARGS
include_test(submodule)
end
end
Expand Down
5 changes: 4 additions & 1 deletion test/InputOutput/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ using Test, Pkg
@testset "InputOutput" begin
all_tests = isempty(ARGS) || "all" in ARGS ? true : false
for submodule in ["Writers"]
if all_tests || "$submodule" in ARGS || "InputOutput" in ARGS
if all_tests ||
"$submodule" in ARGS ||
"InputOutput/$submodule" in ARGS ||
"InputOutput" in ARGS
include_test(submodule)
end
end
Expand Down
18 changes: 3 additions & 15 deletions test/Numerics/DGMethods/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,9 @@ using MPI, Test
include(joinpath("..", "..", "testhelpers.jl"))

@testset "DGMethods" begin
runmpi(joinpath(@__DIR__, "vars_test.jl"))
runmpi(joinpath(@__DIR__, "courant.jl"), ntasks = 2)
runmpi(joinpath(@__DIR__, "horizontal_integral_test.jl"))
runmpi(joinpath(@__DIR__, "integral_test.jl"))
runmpi(joinpath(@__DIR__, "integral_test_sphere.jl"))
runmpi(joinpath(@__DIR__, "Euler/isentropicvortex.jl"))
runmpi(joinpath(@__DIR__, "Euler/isentropicvortex_imex.jl"))
runmpi(joinpath(@__DIR__, "Euler/isentropicvortex_multirate.jl"))
runmpi(joinpath(
@__DIR__,
"advection_diffusion/pseudo1D_advection_diffusion.jl",
))
runmpi(joinpath(
@__DIR__,
"advection_diffusion/advection_diffusion_model_1dimex_bgmres.jl",
))
runmpi(joinpath(@__DIR__, "compressible_Navier_Stokes/ref_state.jl"))
runmpi(joinpath(@__DIR__, "horizontal_integral_test.jl"))
runmpi(joinpath(@__DIR__, "courant.jl"), ntasks = 2)
runmpi(joinpath(@__DIR__, "vars_test.jl"))
end
Loading

0 comments on commit cef6389

Please sign in to comment.