-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (79 loc) · 2.61 KB
/
easy_orm_ci.yaml
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
name: Dart CI
on:
push:
pull_request:
schedule:
# runs the CI everyday at 10AM
- cron: "0 10 * * *"
jobs:
# Label of the container job
container-job:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container:
image: dart:2.18.2
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
# Check postgres is up and ready
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Check out app and get dependencies
working-directory: ./easy_orm_postgres
run: |
dart pub get
- uses: actions/checkout@v3
- name: Check out app and get dependencies
working-directory: ./easy_orm_cli
run: |
dart pub get
- uses: actions/checkout@v3
- name: Check out app and get dependencies
working-directory: ./example
run: |
dart pub get
- name: Install psql #so we can run scripts
run: |
apt-get update
apt-get install --yes --no-install-recommends postgresql-client
- name: Load Northwind.sql into postgres
working-directory: .
run: |
export PGPASSWORD='postgres'
psql -U postgres -d postgres -h postgres -p 5432 -a -f resources/northwind.sql
- name: Run tests engine
working-directory: ./easy_orm_postgres
run: dart run test
env:
TEST_DB_CONFIG: ciserver_test_db.yaml
- name: Run tests cli
working-directory: ./easy_orm_cli
run: dart run test
env:
TEST_DB_CONFIG: ciserver_test_db.yaml
- name: Run example generate
working-directory: ./example
run: dart ../easy_orm_cli/bin/easy_orm_cli.dart generate --host postgres --port 5432 --db postgres -u postgres -p postgres --schema public --package example
- name: Build freezed objects for example
working-directory: ./example
run: dart run build_runner build --delete-conflicting-outputs
- name: Run tests example
working-directory: ./example
run: dart run test
env:
TEST_DB_CONFIG: ciserver_test_db.yaml