-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (84 loc) · 2.52 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
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
name: CI
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy
override: true
- uses: Swatinem/rust-cache@v1
- run: cargo clippy --all-features -- -D warnings
- run: cargo fmt -- --check
semver-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Run cargo-semver-checks
shell: bash
run: |
export CARGO_TERM_COLOR=always
cargo install cargo-semver-checks --locked
cargo semver-checks check-release
test:
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_PORT: 5432
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust:
- stable
- 1.56
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- run: cargo build --tests
- run: cargo test -- --nocapture --quiet
publish-schemer:
uses: aschampion/gh-actions/.github/workflows/rust-publish.yml@v0
needs: [test, lint]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/schemer-v')
secrets: inherit
with:
working-directory: schemer
tag-prefix: schemer
publish-schemer-postgres:
uses: aschampion/gh-actions/.github/workflows/rust-publish.yml@v0
needs: [test, lint]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/schemer-postgres-v')
secrets: inherit
with:
working-directory: schemer-postgres
tag-prefix: schemer-postgres
publish-schemer-rusqlite:
uses: aschampion/gh-actions/.github/workflows/rust-publish.yml@v0
needs: [test, lint]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/schemer-rusqlite-v')
secrets: inherit
with:
working-directory: schemer-rusqlite
tag-prefix: schemer-rusqlite