Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into wflow.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
sverhoeven committed Nov 7, 2024
2 parents 873f117 + c1a916c commit 484f575
Show file tree
Hide file tree
Showing 29 changed files with 2,111 additions and 87 deletions.
26 changes: 8 additions & 18 deletions .github/workflows/ci.yml → .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
name: Validate OpenAPI
name: Validate OpenAPI.yaml

on:
push:
paths:
- "openapi.yaml"
pull_request:
- .github/workflows/openapi.yml
pull_request_target:
paths:
- "openapi.yaml"
- .github/workflows/openapi.yml

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lintspec:
Expand Down Expand Up @@ -38,19 +44,3 @@ jobs:

- name: Yamllint
run: yamllint openapi.yaml

python:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install ruff
run: pip install ruff
- name: Run ruff
run: ruff check python/remotebmi
56 changes: 56 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Python

on:
push:
paths:
- "openapi.yaml"
- "python/remotebmi/**"
- "python/tests/**"
- .github/workflows/python.yml
pull_request_target:
paths:
- "openapi.yaml"
- "python/remotebmi/**"
- "python/tests/**"
- .github/workflows/python.yml

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
working-directory: python

jobs:
lint-format:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install ruff
run: pip install ruff
- name: Run ruff check
run: ruff check
- name: Run ruff format
run: ruff format --check
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install dependencies
run: pip install -e .[dev]
- name: Run tests
run: pytest tests
65 changes: 65 additions & 0 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: R

on:
push:
paths:
- "R/remotebmi/**"
- .github/workflows/r.yml
pull_request_target:
paths:
- "R/remotebmi/**"
- .github/workflows/r.yml

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
id-token: write # This is required for requesting the JWT

jobs:
r:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, any::covr, any::xml2
needs: check, coverage
working-directory: R/remotebmi
- uses: r-lib/actions/check-r-package@v2
with:
working-directory: R/remotebmi
- name: Test coverage
working-directory: R/remotebmi
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./R/remotebmi/cobertura.xml
plugin: noop
disable_search: true
use_oidc: true
- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/R/remotebmi/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/R/remotebmi/package
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ python/heat.toml
RemoteBMI.jl/example/Project.toml
RemoteBMI.jl/example/heat.toml
openapi-generator-cli.jar
openapitools.json
openapitools.json
PEQ_Hupsel.dat
walrus.yml
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Contributing

## AI Assistance

The documentation/software code in this repository can and has been partly generated and/or refined using
GitHub CoPilot. All AI-output has been verified for correctness,
accuracy and completeness, adapted where needed, and approved by the author.

## Add another language

A directory of the name of the language should be created in the root of the repository.
Expand Down
1 change: 1 addition & 0 deletions R/remotebmi/.Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^LICENSE\.md$
21 changes: 21 additions & 0 deletions R/remotebmi/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Package: remotebmi
Title: BMI over http
Version: 0.0.0.9000
Authors@R:
person("Stefan", "Verhoeven", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "https://orcid.org/0000-0002-5821-2060"))
Description: Runs a BMI model as a http json web service.
URL: https://github.com/eWaterCycle/remotebmi
License: Apache License (>= 2)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Imports:
fiery,
reqres,
routr
Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
Remotes:
eWaterCycle/bmi-r
Loading

0 comments on commit 484f575

Please sign in to comment.