This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
124 lines (109 loc) · 3.95 KB
/
test.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
name: Cargo tests
on:
push:
branches:
- main
pull_request:
jobs:
clippy:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-Dwarnings"
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
components: clippy
override: true
toolchain: stable
- name: Install dependencies
run: sudo apt install -y openssl libkrb5-dev
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features=all
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
components: rustfmt
override: true
toolchain: stable
- uses: mbrobbel/rustfmt-check@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
cargo-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features:
- "--lib --features=all"
- "--lib --no-default-features --features=sqlite"
- "--lib --no-default-features --features=sqlite --features=chrono --features=json --features=uuid --features=pooled --features=serde-support --features=bigdecimal"
- "--lib --no-default-features --features=postgresql"
- "--lib --no-default-features --features=postgresql --features=chrono --features=json --features=uuid --features=pooled --features=serde-support --features=bigdecimal"
- "--lib --no-default-features --features=mysql"
- "--lib --no-default-features --features=mysql --features=chrono --features=json --features=uuid --features=pooled --features=serde-support --features=bigdecimal"
- "--lib --no-default-features --features=mssql"
- "--lib --no-default-features --features=mssql --features=chrono --features=json --features=uuid --features=pooled --features=serde-support --features=bigdecimal"
- "--doc --features=all"
env:
TEST_MYSQL: "mysql://root:prisma@localhost:3306/prisma"
TEST_MYSQL8: "mysql://root:prisma@localhost:3307/prisma"
TEST_MYSQL_MARIADB: "mysql://root:prisma@localhost:3308/prisma"
TEST_PSQL: "postgres://postgres:prisma@localhost:5432/postgres"
TEST_MSSQL: "jdbc:sqlserver://localhost:1433;database=master;user=SA;password=<YourStrong@Passw0rd>;trustServerCertificate=true"
TEST_CRDB: "postgresql://[email protected]:26259/postgres"
RUSTFLAGS: "-Dwarnings"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.features }}
- name: Start Databases
run: docker-compose -f docker-compose.yml up -d
- name: Sleep for 20s
uses: juliangruber/sleep-action@v1
with:
time: 20s
- name: Run tests
run: cargo test ${{ matrix.features }}
rustdoc:
needs: [clippy, format, cargo-test]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: linux-cargo-rustdoc
- name: Generate documentation
run: |
cargo +nightly rustdoc --all-features
- name: Deploy Documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./target/doc
SCRIPT_MODE: true
run: |
wget https://gist.githubusercontent.com/pimeys/73853d2718a99a471ce82d481002de50/raw/13ccccccfb0a11db3fbe90eeacafa487a80e6068/entrypoint.sh
bash ./entrypoint.sh