Skip to content

Commit

Permalink
add Test
Browse files Browse the repository at this point in the history
  • Loading branch information
kongdd committed Jan 16, 2024
1 parent f7eabff commit e3afd5f
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 11 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# https://github.com/Alexander-Barth/NCDatasets.jl/blob/master/.github/workflows/ci.yml
name: CI
on:
- push
- pull_request
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
# - '1.3'
- '1'
# - 'nightly'
os:
# - ubuntu-latest
# - macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@latest
- run: |
git config --global user.name Tester
git config --global user.email [email protected]
- uses: julia-actions/julia-runtest@latest
continue-on-error: ${{ matrix.version == 'nightly' }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
24 changes: 24 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CompatHelper

on:
schedule:
- cron: '15 23 */4 * *'

jobs:
CompatHelper:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.2.0]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
20 changes: 20 additions & 0 deletions .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Documenter
on:
push:
branches: [master, main]
tags: [v*]
pull_request:
branches: [master, main]
jobs:
Documenter:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@latest
env:
RASTERDATASOURCES_PATH: ".."
GKSwstype: "100"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
15 changes: 15 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ MutableNamedTuples = "af6c499f-54b4-48cc-bbd2-094bba7533c7"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"

[compat]
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

Boreal Ecosystem Productivity Simulator in Julia

<!-- badges: start -->
<!-- badges: end -->
<!-- [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://CUG-hydro.github.io/BEPS.jl/stable) -->
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://CUG-hydro.github.io/BEPS.jl/dev)
[![CI](https://github.com/CUG-hydro/BEPS.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/CUG-hydro/BEPS.jl/actions/workflows/CI.yml)
[![Codecov](https://codecov.io/gh/CUG-hydro/BEPS.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/CUG-hydro/BEPS.jl)

> Dongdong Kong

## Usage
Expand Down
4 changes: 1 addition & 3 deletions src/BEPS/BEPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ include("sensible_heat.jl")
include("surface_temperature.jl")
include("transpiration.jl")

export s_coszs, lai2
# , readparam
# , readcoef
export s_coszs, lai2, readparam, readcoef
export aerodynamic_conductance_jl,
sensible_heat_jl,
surface_temperature_jl,
Expand Down
2 changes: 1 addition & 1 deletion src/clang/BEPS_c.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ end
export inter_prg_c,
Vcmax_Jmax,
# readparam,
readcoef,
# readcoef,
# lai2, s_coszs,
Leaf_Temperatures,
latent_heat!,
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using Test
using BEPS

include("test_readparam.jl")
7 changes: 2 additions & 5 deletions examples/test_01.jl → test/test_readparam.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Test

using BEPS
# import BEPS: readparam, readcoef

@testset "readparam" begin
lcs = [1, 2, 6, 9, 13, 40, -1]
Expand All @@ -22,7 +23,3 @@ end
@test maximum(abs.(coef1 .- coef2)) == 0
end
end



# Test init soil

0 comments on commit e3afd5f

Please sign in to comment.