-
Notifications
You must be signed in to change notification settings - Fork 6
41 lines (39 loc) · 1.51 KB
/
CI.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
on: [push, pull_request]
name: CI
jobs:
test:
name: Cortex
runs-on: ubuntu-latest
env:
DB_HOST: localhost
DB_USERNAME: postgres
PGPASSWORD: postgres
steps:
- name: Install CorTeX Dependencies
uses: ryankurte/[email protected]
with:
packages: "postgresql postgresql-contrib postgresql-client libpq-dev libarchive-dev libsodium-dev libzmq3-dev"
- name: Start PostgreSQL on Ubuntu
run: |
sudo systemctl start postgresql.service
- name: Setup Postgresql DB
run: |
sudo -u postgres psql -c 'create database cortex;'
sudo -u postgres psql -c 'create database cortex_tester;'
sudo -u postgres psql -c "create user cortex with password 'cortex';"
sudo -u postgres psql -c "create user cortex_tester with password 'cortex_tester';"
sudo -u postgres psql -c 'GRANT ALL PRIVILEGES ON DATABASE cortex TO cortex;'
sudo -u postgres psql -c 'GRANT ALL PRIVILEGES ON DATABASE cortex_tester TO cortex_tester;'
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: |
cargo install diesel_cli --vers 1.1.2 --no-default-features --features postgres
diesel migration run
DATABASE_URL="postgres://cortex_tester:cortex_tester@localhost/cortex_tester" diesel migration run
- uses: actions-rs/cargo@v1
with:
command: test