Publish examples so they can be reused #90
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and test DataSQRL Examples | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| repo: | |
| description: Test runner | |
| required: true | |
| default: 'zharec' | |
| type: string | |
| note: | |
| description: Test note | |
| required: true | |
| default: 'Smoke test' | |
| type: string | |
| example: | |
| description: Example to test | |
| required: true | |
| type: choice | |
| default: healthcare | |
| options: | |
| - finance | |
| - healthcare | |
| - logistics | |
| - iot-sensor | |
| - retail | |
| - recommendation | |
| - law | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| TZ: 'America/Los_Angeles' | |
| steps: | |
| - name: Setup Timezone | |
| uses: szenius/set-timezone@v1.1 | |
| with: | |
| timezoneLinux: "America/Los_Angeles" | |
| - name: Pull SQRL Docker image | |
| run: docker pull datasqrl/cmd:v0.5.6 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Run Healthcare Analytics Test | |
| if: ${{ github.event.inputs.example == 'healthcare' }} | |
| working-directory: ./healthcare-study-monitoring | |
| run: | | |
| docker run -i -p 8888:8888 -p 8081:8081 --rm -v $PWD:/build -e LOCAL_WAREHOUSE_DIR=/tmp/warehouse datasqrl/cmd:v0.5.6 test -c study_analytics_package.json study_analytics.sqrl --snapshot snapshots-study-analytics | |
| continue-on-error: false | |
| - name: Run Healthcare Study Api Test | |
| if: ${{ github.event.inputs.example == 'healthcare' }} | |
| working-directory: ./healthcare-study-monitoring | |
| run: | | |
| docker run -i -p 8888:8888 -p 8081:8081 --rm -v $PWD:/build datasqrl/cmd:v0.5.6 test -c study_api_test_package.json --tests tests-api --snapshot snapshots-study-api | |
| continue-on-error: false | |
| - name: Run Healthcare Study Stream Test | |
| if: ${{ github.event.inputs.example == 'healthcare' }} | |
| working-directory: ./healthcare-study-monitoring | |
| run: | | |
| docker run -i -p 8888:8888 -p 8081:8081 --rm -v $PWD:/build datasqrl/cmd:v0.5.6 test -c study_stream_local_package.json study_stream.sqrl --snapshot snapshots-study-stream | |
| continue-on-error: false | |
| - name: Run Healthcare Create Api Test | |
| if: ${{ github.event.inputs.example == 'healthcare' }} | |
| working-directory: ./healthcare-study-monitoring | |
| run: | | |
| docker run -i -p 8888:8888 -p 8081:8081 --rm -v $PWD:/build datasqrl/cmd:v0.5.6 compile study_create_api.sqrl | |
| continue-on-error: false | |
| - name: Run Finance Analytics Test | |
| working-directory: finance-credit-card-chatbot/ | |
| run: | | |
| docker run -i -p 8888:8888 -p 8081:8081 --rm -v $PWD:/build datasqrl/cmd:v0.5.6 test -c package-analytics-local.json --snapshot snapshots-analytics | |
| continue-on-error: false | |
| - name: Run Finance Rewards Test | |
| working-directory: finance-credit-card-chatbot/ | |
| run: | | |
| docker run -i -p 8888:8888 -p 8081:8081 --rm -v $PWD:/build datasqrl/cmd:v0.5.6 test test -c package-rewards-local.json --snapshot snapshots-rewards | |
| continue-on-error: false | |
| - name: Publish finance | |
| uses: docker/build-push-action@v3 | |
| with: | |
| context: finance-credit-card-chatbot | |
| file: finance-credit-card-chatbot/Dockerfile | |
| push: true | |
| tags: datasql/examples:finance | |
| platforms: linux/amd64,linux/arm64 | |
| - name: Run Clickstream Recommendation Test | |
| if: ${{ github.event.inputs.example == 'recommendation' }} | |
| working-directory: ./clickstream-ai-recommendation | |
| run: | | |
| docker run -i -p 8888:8888 -p 8081:8081 -p 9092:9092 --rm -v $PWD:/build datasqrl/cmd:v0.5.6 test test -c package.json --snapshot snapshots | |
| continue-on-error: false | |
| - name: Run IoT Sensor Test | |
| if: ${{ github.event.inputs.example == 'iot-sensor' }} | |
| working-directory: ./iot-sensor-metrics | |
| run: | | |
| docker run -i -p 8888:8888 -p 8081:8081 -p 9092:9092 --rm -v $PWD:/build datasqrl/cmd:v0.5.6 test sensors.sqrl --snapshot snapshots | |
| continue-on-error: false | |
| - name: Run Logistics Test | |
| if: ${{ github.event.inputs.example == 'logistics' }} | |
| working-directory: ./logistics-shipping-geodata | |
| run: | | |
| docker run -i -p 8888:8888 -p 8081:8081 -p 9092:9092 --rm -v $PWD:/build datasqrl/cmd:v0.5.6 test logistics.sqrl --snapshot snapshots | |
| continue-on-error: false | |
| - name: Run Retail Test | |
| if: ${{ github.event.inputs.example == 'retail' }} | |
| working-directory: ./retail-customer360-nutshop | |
| run: | | |
| docker run -i -p 8888:8888 -p 8081:8081 -p 9092:9092 --rm -v $PWD:/build datasqrl/cmd:v0.5.6 test customer360.sqrl --snapshot snapshots | |
| continue-on-error: false | |
| - name: Run Law Enforcement Test | |
| if: ${{ github.event.inputs.example == 'law' }} | |
| working-directory: ./law-enforcement | |
| run: | | |
| docker run -i -p 8888:8888 -p 8081:8081 -p 9092:9092 --rm -v $PWD:/build datasqrl/cmd:v0.5.6 test -c baseball-card-local.json --snapshot snapshots | |
| continue-on-error: false | |
| - name: Run anyway | |
| if: ${{ github.event.inputs.example != 'healthcare' }} | |
| run: | | |
| echo "This ran, I guess that is a good thing" | |
| continue-on-error: true | |