-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (135 loc) · 4.53 KB
/
storage-tests.yml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Storage Tests
on:
push:
branches:
- main
- master
pull_request:
env:
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down
# aws args
AWS_REGION: "${{ secrets.AWS_REGION }}"
PYTHON_VERSION: "3.11"
AWS_CLOUD_BUCKET_NAME: "${{ secrets.AWS_CLOUD_BUCKET_NAME }}"
# gcs args
GOOGLE_ACCOUNT_JSON_BASE64: ${{ secrets.GOOGLE_ACCOUNT_JSON_BASE64 }}
GCS_CLOUD_BUCKET_NAME: "${{ secrets.GCS_CLOUD_BUCKET_NAME }}"
#azure args
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_CLOUD_BUCKET_NAME: "${{ secrets.AZURE_CLOUD_BUCKET_NAME }}"
jobs:
aws-rust-lints-test:
permissions:
id-token: write
contents: read
env:
OPSML_SERVER_PORT: 3000
OPSML_STORAGE_URI: s3://${{ secrets.AWS_CLOUD_BUCKET_NAME }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- name: Set up Rust
run: rustup override set stable && rustup update
- name: Install clippy
run: rustup component add clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
working-directory: ./crates
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Build opsml_server
working-directory: ./crates
run: cargo build -p opsml-server
- name: Run opsml_server in the background
run: ./target/debug/opsml-server &
env:
OPSML_STORAGE_URI: ${{ env.OPSML_STORAGE_URI }}
OPSML_SERVER_PORT: ${{ env.OPSML_SERVER_PORT }}
- name: Debug List running processes
run: ps aux
- name: Debug Check if port 3000 is open
run: netstat -an | grep 3000
- name: Wait for service to be available
run: |
until curl --output /dev/null --silent --head --fail http://localhost:3000; do
echo "Waiting for the service to be available..."
sleep 5
done
- name: Tests
working-directory: ./crates
run: |
make test.storage.aws.http
env:
RUST_BACKTRACE: 1
OPSML_TRACKING_URI: http://localhost:3000
- name: Shutdown Docker Compose services
run: docker-compose down
gcs-rust-lints-test:
permissions:
id-token: write
contents: read
env:
OPSML_SERVER_PORT: 8080
OPSML_STORAGE_URI: gs://${{ secrets.GCS_CLOUD_BUCKET_NAME }}
GOOGLE_ACCOUNT_JSON_BASE64: ${{ secrets.GOOGLE_ACCOUNT_JSON_BASE64 }}
runs-on: ubuntu-latest
needs: aws-rust-lints-test
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup override set stable && rustup update
- name: Install clippy
run: rustup component add clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
working-directory: ./crates
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Tests
working-directory: ./crates
run: |
make test.storage.gcs.client
env:
RUST_BACKTRACE: 1
azure-rust-lints-test:
needs: gcs-rust-lints-test
permissions:
id-token: write
contents: read
env:
OPSML_STORAGE_URI: az://${{ secrets.AZURE_CLOUD_BUCKET_NAME }}
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Az CLI login"
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Set up Rust
run: rustup override set stable && rustup update
- name: Install clippy
run: rustup component add clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
working-directory: ./crates
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Tests
working-directory: ./crates
run: |
make test.storage.azure.client
sleep 5
make test.storage.azure.http
env:
RUST_BACKTRACE: 1