-
Notifications
You must be signed in to change notification settings - Fork 13
114 lines (92 loc) · 3.31 KB
/
build.yml
File metadata and controls
114 lines (92 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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: 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
- example: oil-gas
path: oil-gas
test_commands: |
run -c package-local.json
env:
TZ: 'America/Los_Angeles'
SQRL_VERSION: 'v0.5.10'
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: |
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: 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