Repository navigation
137 lines (121 loc) · 4.36 KB
/
Copy pathrust.yml
File metadata and controls
137 lines (121 loc) · 4.36 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Rust
on:
push:
branches: [ master, dev]
pull_request:
branches: [ master, dev ]
jobs:
build:
runs-on: ${{ matrix.os }}
env:
MACOSX_DEPLOYMENT_TARGET: 10.11
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
# windows-latest
steps:
- uses: actions/checkout@v2
# for some reason cache does not work properly with macos builds
- name: Cache Cargo
if: matrix.os != 'macos-12'
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-csml-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Create mongoDB Docker container
if: matrix.os == 'ubuntu-22.04'
run: sudo docker run -d -p 27017:27017 mongo:latest
- name: Install postgres (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev postgresql
echo "host all all 127.0.0.1/32 md5" > sudo tee -a /etc/postgresql/10/main/pg_hba.conf
sudo service postgresql restart && sleep 3
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
sudo service postgresql restart && sleep 3
- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --manifest-path=csml_interpreter/Cargo.toml
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --manifest-path=csml_interpreter/Cargo.toml
# Warning: only one live test can run at once!
- name: Test csml_engine with (Mongodb)
uses: actions-rs/cargo@v1
if: matrix.os == 'ubuntu-22.04'
with:
command: test
args: --verbose --manifest-path=csml_engine/Cargo.toml -j 1 --features "mongo" -- --test-threads=1
env:
ENGINE_DB_TYPE: mongodb
MONGODB_DATABASE: csml
MONGODB_HOST: localhost
MONGODB_PORT: '27017'
MONGODB_USERNAME: ''
MONGODB_PASSWORD: ''
ENGINE_SERVER_PORT: '5000'
ENCRYPTION_SECRET: someDefault.Secr3tValue
DISABLE_SSL_VERIFY: 'false'
DEBUG: 'true'
# Warning: only one live test can run at once!
- name: Test csml_engine with (Postgres)
uses: actions-rs/cargo@v1
if: matrix.os == 'ubuntu-22.04'
with:
command: test
args: --verbose --manifest-path=csml_engine/Cargo.toml -j 1 --features "postgresql" -- --test-threads=1
env:
ENGINE_DB_TYPE: postgresql
POSTGRESQL_URL: postgres://postgres:postgres@localhost/
ENGINE_SERVER_PORT: '5000'
ENCRYPTION_SECRET: someDefault.Secr3tValue
DEBUG: 'true'
# Warning: only one live test can run at once!
- name: Test csml_engine with (dynamodb)
uses: actions-rs/cargo@v1
if: matrix.os == 'ubuntu-22.04'
with:
command: test
args: --verbose --manifest-path=csml_engine/Cargo.toml -j 1 --features "dynamo" -- --test-threads=1
env:
ENGINE_DB_TYPE: dynamodb
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DYNAMODB_TABLE: ${{ secrets.AWS_DYNAMODB_TABLE }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
ENGINE_SERVER_PORT: '5000'
ENCRYPTION_SECRET: someDefault.Secr3tValue
DISABLE_SSL_VERIFY: 'false'
DEBUG: 'true'
# Warning: only one live test can run at once!
- name: Test csml_server endpoint (dynamodb)
uses: actions-rs/cargo@v1
if: matrix.os == 'ubuntu-22.04'
with:
command: test
args: --verbose --manifest-path=csml_server/Cargo.toml -j 1 --features csml_engine/dynamo -- --test-threads=1
env:
ENGINE_DB_TYPE: dynamodb
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DYNAMODB_TABLE: ${{ secrets.AWS_DYNAMODB_TABLE }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
ENGINE_SERVER_PORT: '5000'
ENCRYPTION_SECRET: someDefault.Secr3tValue
DISABLE_SSL_VERIFY: 'false'
DEBUG: 'true'