-
-
Notifications
You must be signed in to change notification settings - Fork 807
64 lines (52 loc) · 1.75 KB
/
linux.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
name: CI (Linux)
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [master]
jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
version: [stable, nightly]
name: ${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with:
toolchain: ${{ matrix.version }}
- name: Install DB CLI tools
run: |
cargo install sqlx-cli --no-default-features --features=rustls,sqlite
cargo install diesel_cli --no-default-features --features sqlite
- name: Create Test DBs
env:
DATABASE_URL: sqlite://./todo.db
run: |
sudo apt-get update && sudo apt-get install sqlite3
sqlx database create
chmod a+rwx ./todo.db
sqlx migrate run --source=./basics/todo/migrations
- name: cargo check
run: cargo check --workspace --bins --examples --tests
timeout-minutes: 30
- name: Start Redis
uses: supercharge/redis-github-action@1.5.0
with: { redis-version: 6 }
- name: cargo test
run: cargo test --workspace --all-features --no-fail-fast --exclude=diesel-example -- --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=diesel-example --no-fail-fast -- --nocapture
timeout-minutes: 10
- name: Clear the cargo caches
run: cargo install cargo-cache --version=0.8.3 --no-default-features --features=ci-autoclean && cargo-cache