-
-
Notifications
You must be signed in to change notification settings - Fork 14
114 lines (100 loc) · 3.1 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
checks:
name: Checks
uses: ./.github/workflows/checks.yml
build:
name: ${{ matrix.platform }}
needs: [ checks ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
platform:
- linux-x64
- macos-arm64
- macos-x64
- windows-x64
include:
- platform: linux-x64
os: ubuntu-22.04
- platform: macos-arm64
os: macos-14
- platform: macos-x64
os: macos-13
- platform: windows-x64
os: windows-2022
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
components: 'llvm-tools-preview'
toolchain: stable
- name: Install grcov
uses: taiki-e/install-action@main
with:
tool: grcov
- name: Tests
if: ${{ !startsWith(matrix.os, 'ubuntu-') }}
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RUST_LOG: "info,postgresql_archive=debug,postgresql_commands=debug,postgresql_embedded=debug"
RUST_LOG_SPAN_EVENTS: full
run: |
cargo test
- name: Tests
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
LLVM_PROFILE_FILE: postgresql-%p-%m.profraw
RUST_LOG: "info,postgresql_archive=debug,postgresql_commands=debug,postgresql_embedded=debug"
RUST_LOG_SPAN_EVENTS: full
RUSTFLAGS: -Cinstrument-coverage
RUSTDOCFLAGS: -Cinstrument-coverage
run: |
cargo test --workspace --all-features
- name: Produce coverage info
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: |
grcov $(find . -name "postgresql-*.profraw" -print) \
-s . \
--branch \
--ignore-not-existing \
--ignore='target/*' \
--ignore='benches/*' \
--ignore='/*' \
--binary-path ./target/debug/ \
--excl-line='#\[derive' \
-t lcov \
-o lcov.info
- name: Upload to codecov.io
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Install benchmarking tools
if: ${{ github.ref == 'refs/heads/main' && startsWith(matrix.os, 'ubuntu-') }}
uses: bencherdev/bencher@main
- name: Run benchmarks
if: ${{ github.ref == 'refs/heads/main' && startsWith(matrix.os, 'ubuntu-') }}
env:
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_PROJECT: theseus-rs-postgresql-embedded
BENCHER_ADAPTER: rust_criterion
run: |
bencher run "cargo bench --features blocking"