Enable compile -c package-rewards-local.json #31
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: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - example: recommendation | |
| path: clickstream-ai-recommendation | |
| test_commands: | | |
| compile -c package-api.json | |
| compile -c package-kafka.json | |
| - example: finance | |
| path: finance-credit-card-chatbot | |
| test_commands: | | |
| compile -c package-rewards-local.json | |
| compile -c package-rewards-kafka.json | |
| test -c package-analytics-local.json --snapshots snapshots-analytics | |
| test -c package-rewards-local.json --snapshots snapshots-rewards | |
| - example: healthcare | |
| path: healthcare-study-monitoring | |
| test_commands: | | |
| test -c study_analytics_package.json study_analytics.sqrl --snapshots snapshots-study-analytics | |
| test -c study_api_test_package.json --tests tests-study-api --snapshots snapshots-study-api | |
| test -c study_stream_local_package.json study_stream.sqrl --snapshots snapshots-study-stream | |
| compile -c study_stream_kafka_package.json | |
| compile -c study_analytics_snowflake_package.json | |
| - example: logistics | |
| path: logistics-shipping-geodata | |
| test_commands: | | |
| test logistics.sqrl --snapshots snapshots | |
| - example: iot-sensor | |
| path: iot-sensor-metrics | |
| test_commands: | | |
| test -c sensor-static.json --snapshots snapshots-static | |
| test -c sensor-api.json --tests test-api --snapshots snapshots-api | |
| - example: law | |
| path: law-enforcement | |
| test_commands: | | |
| test -c baseball-card-local.json --snapshots snapshots | |
| - example: oil-gas | |
| path: oil-gas-agent-automation | |
| test_commands: | | |
| test -c package-local.json | |
| env: | |
| TZ: 'America/Los_Angeles' | |
| SQRL_VERSION: '0.6.0' | |
| 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:${{ env.SQRL_VERSION }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Run ${{ matrix.example }} Tests | |
| working-directory: ${{ matrix.path }} | |
| run: | | |
| if [ -z "${{ matrix.test_commands }}" ]; then | |
| echo "ERROR: No test commands specified for ${{ matrix.example }}" | |
| exit 1 | |
| fi | |
| while IFS= read -r cmd; do | |
| echo "::group::Running: $cmd" | |
| docker run -i -p 8888:8888 -p 8081:8081 -p 9092:9092 --rm -v $PWD:/build datasqrl/cmd:${SQRL_VERSION} $cmd | |
| echo "::endgroup::" | |
| done < <(printf '%s\n' "${{ matrix.test_commands }}") | |
| - name: Write Dockerfile | |
| run: | | |
| cat <<EOF > ${{ matrix.path }}/Dockerfile | |
| FROM datasqrl/cmd:${SQRL_VERSION} | |
| ENV TZ="UTC" | |
| 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 |