diff --git a/.github/ctests.yml b/.github/ctests.yml new file mode 100644 index 0000000000000000000000000000000000000000..69ff355cb49947746aac9cc6df4e8bf23cbb67f4 --- /dev/null +++ b/.github/ctests.yml @@ -0,0 +1,149 @@ +name: CMake + +on: [push, pull_request] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build-library: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + defaults: + run: + shell: bash -l {0} + env: + SSPICE_DEBUG: y + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: "latest" + activate-environment: spiceql + environment-file: environment.yml + auto-activate-base: false + auto-update-conda: true + + - name: Conda info + run: | + conda info + conda list + + - name: Checkout submodules + uses: snickerbockers/submodules-init@v4 + + - name: Create Build Environment + # Some projects don't allow in-source building, so create separate build and install + # directorie; we'll use them as our working directories for subsequent commands. + run: | + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/install + + - name: Configure CMake + working-directory: ${{github.workspace}}/build + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCSpice_DIR=$CONDA/envs/spiceql/lib/cmake/cspice/ -Dfmt_DIR=$CONDA/envs/spiceql/lib/cmake/fmt/ -DSPICEQL_BUILD_DOCS=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install + + - name: Build + working-directory: ${{github.workspace}}/build + # Execute the build. You can specify a specific target with "--target " + run: | + cmake --build . --config $BUILD_TYPE + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -VV -C $BUILD_TYPE + + - name: Install + working-directory: ${{github.workspace}}/build + # Execute the install. You can specify a specific target with "--target " + run: | + cmake --install . --config $BUILD_TYPE + + - name: Check install + working-directory: ${{github.workspace}}/install + # Check that the library installed properly + run: | + if [ "$RUNNER_OS" == "macOS" ]; then + test -e lib/libSpiceQL.dylib + elif [ "$RUNNER_OS" == "Linux" ]; then + test -e lib/libSpiceQL.so + fi + test -e include/SpiceQL/spiceql.h + rm -rf ${{github.workspace}}/build + python -c "import pyspiceql" + + # compair all json files against the schema + - name: check json files + working-directory: ${{github.workspace}}/SpiceQL/db/schema + run: | + for file in *.json; + do + pwd + jsonschema --instance "$file" spiceMissionSchmea.schema.json + done; + + build-docs: + + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: "latest" + activate-environment: spiceql + environment-file: environment.yml + auto-activate-base: false + auto-update-conda: true + + - name: Conda info + run: | + conda info + conda list + + - name: Create Build Environment + # Some projects don't allow in-source building, so create separate build and install + # directorie; we'll use them as our working directories for subsequent commands. + run: | + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/install + + - name: Configure CMake + working-directory: ${{github.workspace}}/build + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSPICEQL_BUILD_LIB=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install + + - name: Build + working-directory: ${{github.workspace}}/build + # Execute the build. + run: | + cmake --build . --config $BUILD_TYPE + + - name: Check Build Docs + working-directory: ${{github.workspace}}/build/docs/sphinx + # Check for the built docs + run: | + test -e index.html + test -e reference/api.html + test -e reference/tutorials.html + + - name: Install Docs + working-directory: ${{github.workspace}}/build + # Install the build. + run: | + cmake --install . --config $BUILD_TYPE + + - name: Check Install Docs + working-directory: ${{github.workspace}}/install + # Check for the built docs + run: | + test -e share/doc/SpiceQL/sphinx/index.html + test -e share/doc/SpiceQL/sphinx/reference/api.html + test -e share/doc/SpiceQL/sphinx/reference/tutorials.html \ No newline at end of file diff --git a/.github/deploy.yml b/.github/deploy.yml new file mode 100644 index 0000000000000000000000000000000000000000..58ed65e1a61aceefcacbda99ddfa7ed0366e9400 --- /dev/null +++ b/.github/deploy.yml @@ -0,0 +1,34 @@ +name: Deploy + +on: + push: + branches: + - main + +env: + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + +jobs: + deploy-build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + defaults: + run: + shell: bash -l {0} + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: "latest" + auto-activate-base: true + auto-update-conda: true + - name: Setup conda tools + run: | + conda config --set always_yes yes + conda config --set anaconda_upload yes + conda install -c conda-forge conda-build anaconda-client conda-verify + - name: Build tarbll + run: | + conda build --user usgs-astrogeology --label dev -c conda-forge -c tudat-team recipe/