diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..e71dc8c2c6fa8b89b0f8aa4587073ff1e425ebd6 --- /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 0000000000000000000000000000000000000000..e89330a618c137cdaccde46f87923736cc04dfb4 --- /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 0000000000000000000000000000000000000000..9f0ee31d48ee4b3d67470b8203be4ba07c60b698 --- /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 0000000000000000000000000000000000000000..ad36d3fe6bfe2b46a8967cb74a2ed97307aff8ec --- /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 0000000000000000000000000000000000000000..e71dc8c2c6fa8b89b0f8aa4587073ff1e425ebd6 --- /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 0000000000000000000000000000000000000000..5bff07084f027f289f8c08eee08f3a50131fc423 --- /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)