-
Notifications
You must be signed in to change notification settings - Fork 13
Publish examples so they can be reused #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,128 +1,110 @@ | ||
| 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: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - example: finance | ||
| path: finance-credit-card-chatbot | ||
| test_commands: | | ||
| test -c package-analytics-local.json --snapshot snapshots-analytics | ||
| test -c package-rewards-local.json --snapshot snapshots-rewards | ||
|
|
||
| - example: healthcare | ||
| path: healthcare-study-monitoring | ||
| test_commands: | | ||
| test -c study_analytics_package.json study_analytics.sqrl --snapshot snapshots-study-analytics | ||
| test -c study_api_test_package.json --tests tests-api --snapshot snapshots-study-api | ||
| test -c study_stream_local_package.json study_stream.sqrl --snapshot snapshots-study-stream | ||
| compile study_create_api.sqrl | ||
|
|
||
| - example: logistics | ||
| path: logistics-shipping-geodata | ||
| test_commands: | | ||
| test logistics.sqrl --snapshot snapshots | ||
|
|
||
| # - example: iot-sensor | ||
| # path: iot-sensor-metrics | ||
| # test_commands: | | ||
| # test sensors.sqrl --snapshot snapshots | ||
|
|
||
| - example: retail | ||
| path: retail-customer360-nutshop | ||
| test_commands: | | ||
| test customer360.sqrl --snapshot snapshots | ||
|
|
||
| - example: recommendation | ||
| path: clickstream-ai-recommendation | ||
| test_commands: | | ||
| test -c package.json --snapshot snapshots | ||
|
|
||
| - example: law | ||
| path: law-enforcement | ||
| test_commands: | | ||
| test -c baseball-card-local.json --snapshot snapshots | ||
|
|
||
| env: | ||
| TZ: 'America/Los_Angeles' | ||
| SQRL_VERSION: 'v0.5.6' | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - 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: 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 | ||
| run: docker pull datasqrl/cmd:${{ env.SQRL_VERSION }} | ||
|
|
||
| - 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 | ||
| if: ${{ github.event.inputs.example == 'finance' }} | ||
| 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: Set up QEMU | ||
| uses: docker/setup-qemu-action@v2 | ||
|
|
||
| - name: Run Finance Rewards Test | ||
| if: ${{ github.event.inputs.example == 'finance' }} | ||
| 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: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v2 | ||
|
|
||
| - 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: Login to Docker Hub | ||
| uses: docker/login-action@v2 | ||
| with: | ||
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
|
||
| - 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 | ||
| - name: Run ${{ matrix.example }} Tests | ||
| working-directory: ${{ matrix.path }} | ||
| 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 | ||
| while IFS= read -r cmd; do | ||
| echo "Running: $cmd" | ||
| docker run -i -p 8888:8888 -p 8081:8081 -p 9092:9092 --rm -v $PWD:/build datasqrl/cmd:${SQRL_VERSION} $cmd | ||
| done <<< "${{ matrix.test_commands }}" | ||
|
|
||
| - name: Run Retail Test | ||
| if: ${{ github.event.inputs.example == 'retail' }} | ||
| working-directory: ./retail-customer360-nutshop | ||
| - name: Write Dockerfile | ||
| 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 | ||
| cat <<EOF > ${{ matrix.path }}/Dockerfile | ||
| FROM datasqrl/cmd:${SQRL_VERSION} | ||
|
|
||
| - 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 | ||
| ENV TZ="UTC" | ||
|
|
||
| - name: Run anyway | ||
| if: ${{ github.event.inputs.example != 'healthcare' }} | ||
| run: | | ||
| echo "This ran, I guess that is a good thing" | ||
| continue-on-error: true | ||
| COPY . /build | ||
| WORKDIR /build | ||
| EOF | ||
|
|
||
| - name: Publish ${{ matrix.example }} | ||
| uses: docker/build-push-action@v3 | ||
| with: | ||
| context: ./${{ matrix.path }} | ||
| file: ./${{ matrix.path }}/Dockerfile | ||
| push: true | ||
| tags: datasqrl/examples:${{ matrix.example }} | ||
| platforms: linux/amd64,linux/arm64 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get the original workflow building without this step, so I think it never worked before.