From 6d45de3781b60605d28da527cb8eb1b302e11987 Mon Sep 17 00:00:00 2001 From: Brandon Clayton <bclayton@usgs.gov> Date: Tue, 17 Jan 2023 08:24:55 -0700 Subject: [PATCH] add files --- .dockerignore | 15 +++++++++++++ .editorconfig | 13 ++++++++++++ .github/workflows/docker-image.yml | 24 +++++++++++++++++++++ .github/workflows/gradle.yml | 34 ++++++++++++++++++++++++++++++ .gitignore | 15 +++++++++++++ .travis.yml | 13 ++++++++++++ 6 files changed, 114 insertions(+) create mode 100644 .dockerignore create mode 100644 .editorconfig create mode 100644 .github/workflows/docker-image.yml create mode 100644 .github/workflows/gradle.yml create mode 100644 .gitignore create mode 100644 .travis.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..e71dc8c2c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +.classpath +.project +.settings +.gradle +bin +build +classes +tmp +curves*/ +hazout*/ +eq-prob*/ +eq-rate*/ +Scratch*.java +nshmp-haz-log* +.vscode diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..e89330a61 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 000000000..9f0ee31d4 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,24 @@ +name: Build nshmp-haz Docker Image + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - + name: Build the Docker image + run: docker build -t nshmp-haz . + - + name: Test nshmp-haz + run: | + docker run \ + -e PROGRAM=hazard \ + -e MODEL=WUS-2008 \ + -v $(pwd)/etc/examples/3-sites-file/sites.geojson:/app/sites.geojson \ + -v $(pwd)/etc/examples/3-sites-file/config.json:/app/config.json \ + -v $(pwd)/hazout:/app/output \ + nshmp-haz + diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 000000000..ad36d3fe6 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,34 @@ +name: Build nshmp-haz JAR + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - + name: Run Tests with Gradle + run: ./gradlew test + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - + name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - + name: Build with Gradle + run: ./gradlew build + - + name: Test nshmp-haz + run: | + java -cp build/libs/nshmp-haz.jar \ + gov.usgs.earthquake.nshmp.HazardCalc \ + etc/peer/models/Set1-Case1 \ + "Test Site, -122.0, 38.0" diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..e71dc8c2c --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.classpath +.project +.settings +.gradle +bin +build +classes +tmp +curves*/ +hazout*/ +eq-prob*/ +eq-rate*/ +Scratch*.java +nshmp-haz-log* +.vscode diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..5bff07084 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: java + +# Prevent upoad of Gradle cache +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock + - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ +cache: + directories: + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ + +after_success: + - bash <(curl -s https://codecov.io/bash) -- GitLab