-
-
Notifications
You must be signed in to change notification settings - Fork 802
85 lines (70 loc) · 2.28 KB
/
Copy pathci.yml
File metadata and controls
85 lines (70 loc) · 2.28 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
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
merge_group:
types: [checks_requested]
push:
branches: [main]
jobs:
build_and_test:
permissions:
contents: read
strategy:
fail-fast: false
matrix:
version: [stable]
name: ${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install Rust (${{ matrix.version }})
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
toolchain: ${{ matrix.version }}
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get -y install sqlite3
sudo apt-get -y install libpq-dev
sudo apt-get -y install redis-server
- name: Install DB CLI tools
run: |
cargo install --force sqlx-cli --no-default-features --features=sqlite,rustls
cargo install --force diesel_cli --no-default-features --features=sqlite,postgres
- name: Create Test DBs
env:
DATABASE_URL: sqlite://./todo.db
run: |
sqlx database create
chmod a+rwx ./todo.db
sqlx migrate run --source=./basics/todo/migrations
- name: Start Redis
run: |
if ! redis-cli ping; then
redis-server --daemonize yes
fi
redis-cli ping
- name: cargo check
run: cargo check --workspace --bins --examples --tests
timeout-minutes: 30
- name: cargo test
run: cargo test --workspace --all-features --no-fail-fast --exclude=db-diesel -- --nocapture
timeout-minutes: 30
- name: cargo test (diesel)
env:
DATABASE_URL: test.db
run: |
cd databases/diesel
diesel migration run
chmod a+rwx test.db
cargo test -p=db-diesel --no-fail-fast -- --nocapture
timeout-minutes: 10
- name: Install cargo-ci-cache-clean
uses: taiki-e/install-action@b8cecb83565409bcc297b2df6e77f030b2a468d5 # v2.82.0
with:
tool: cargo-ci-cache-clean
- name: CI cache clean
run: cargo-ci-cache-clean