Repository navigation
195 lines (180 loc) · 7.62 KB
/
Copy pathci.yml
File metadata and controls
195 lines (180 loc) · 7.62 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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
---
name: CI
"on":
push:
branches: [main]
pull_request:
schedule:
# Re-proves the generated sources against the pinned releases and the build on current runners.
- cron: "43 6 * * 2"
workflow_call:
permissions:
contents: read
# Each main run gets a group of its own, since GitHub drops a pending run of a group when a newer one queues.
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test ${{ matrix.toolchain }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [stable, "1.81"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
rustup toolchain install "$TOOLCHAIN" --profile minimal
rustup default "$TOOLCHAIN"
env:
TOOLCHAIN: ${{ matrix.toolchain }}
- run: cargo test --all-targets
- run: cargo test --doc
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
rustup toolchain install stable --profile minimal --component rustfmt,clippy
rustup default stable
- run: cargo fmt --check
- run: cargo clippy --all-targets -- -D warnings
- run: cargo fmt --manifest-path interop/native/Cargo.toml --check
- run: cargo fmt --manifest-path interop/web/Cargo.toml --check
- run: cargo clippy --manifest-path interop/native/Cargo.toml --all-targets -- -D warnings
- run: cargo doc --no-deps
env:
RUSTDOCFLAGS: -D warnings
scripts:
name: Scripts and workflows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: shellcheck -x upgrade.sh bump.sh interop/run.sh suite/run.sh tools/releases.sh tools/leg.sh tools/rusqlite-native.sh fuzz/sources.sh fuzz/build.sh
- name: actionlint
run: |
bash <(curl -sSfL https://raw.githubusercontent.com/rhysd/actionlint/914e7df21a07ef503a81201c76d2b11c789d3fca/scripts/download-actionlint.bash) 1.7.12
./actionlint -color
regenerate:
name: Generated sources match the signed releases
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: sudo apt-get install -y --no-install-recommends tcl
- run: ./upgrade.sh
- run: git diff --exit-code
interop:
name: Native and Wasm SQLCipher open each other's files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
rustup toolchain install stable --profile minimal --component clippy --target wasm32-unknown-unknown
rustup default stable
- uses: taiki-e/install-action@b80e2bb2635f28eb98b9fce1e2f0887e1535c6b2 # v2.90.0
with:
tool: wasm-pack
- run: ./interop/run.sh
env:
WASM_BINDGEN_TEST_TIMEOUT: "300"
# A file missing from the package include list only shows up when building from the package.
- name: Interop against the packaged crate
run: |
set -eu
cargo package --quiet
version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
SQLCIPHER_DIR="$PWD/target/package/sqlcipher-src-$version/sqlcipher" ./interop/run.sh
env:
WASM_BINDGEN_TEST_TIMEOUT: "300"
- run: cargo clippy --manifest-path interop/web/Cargo.toml --target wasm32-unknown-unknown --all-targets -- -D warnings
env:
SQLITE_WASM_RS_SOURCE_DIR: ${{ github.workspace }}/sqlcipher
browsers:
name: Wasm SQLCipher runs in Chrome and Firefox
runs-on: ubuntu-latest
env:
SQLITE_WASM_RS_SOURCE_DIR: ${{ github.workspace }}/sqlcipher
WASM_BINDGEN_USE_BROWSER: "1"
WASM_BINDGEN_TEST_TIMEOUT: "300"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
rustup toolchain install stable --profile minimal --target wasm32-unknown-unknown
rustup default stable
- uses: taiki-e/install-action@b80e2bb2635f28eb98b9fce1e2f0887e1535c6b2 # v2.90.0
with:
tool: wasm-pack
# These avoid Node's fs module, and sahpool needs a browser worker for OPFS.
- name: Chrome
working-directory: interop/web
run: wasm-pack test --headless --chrome --release --test encryption --test broken_crypto --test broken_crypto_plain --test sahpool --test bindings
- name: Firefox
working-directory: interop/web
run: wasm-pack test --headless --firefox --release --test encryption --test broken_crypto --test broken_crypto_plain --test sahpool --test bindings
sqlcipher-suite:
name: SQLCipher's own tests pass on the shipped sources
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: sudo apt-get install -y --no-install-recommends tcl-dev
# Cargo resolves the sqlite-wasm-rs revision whose wrapper the testfixture builds.
- run: |
rustup toolchain install stable --profile minimal
rustup default stable
- run: ./suite/run.sh
sanitizers:
name: SQLCipher's own tests are clean under ASAN and UBSan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: sudo apt-get install -y --no-install-recommends tcl-dev
# Cargo resolves the sqlite-wasm-rs revision whose wrapper the testfixture builds.
- run: |
rustup toolchain install stable --profile minimal
rustup default stable
- run: ./suite/run.sh
env:
SANITIZE: "1"
interop-msrv:
name: Interop builds on its declared Rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
set -euo pipefail
floor() { cargo metadata --no-deps --format-version 1 --manifest-path "interop/$1/Cargo.toml" | jq -r '.packages[0].rust_version'; }
native=$(floor native)
web=$(floor web)
rustup toolchain install "$native" --profile minimal
rustup toolchain install "$web" --profile minimal --target wasm32-unknown-unknown
cargo "+$native" check --manifest-path interop/native/Cargo.toml --all-targets
SQLITE_WASM_RS_SOURCE_DIR="$PWD/sqlcipher" cargo "+$web" check --manifest-path interop/web/Cargo.toml --target wasm32-unknown-unknown --all-targets
rusqlite-native:
name: rusqlite's SQLCipher tests pass on these sources natively
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
rustup toolchain install stable --profile minimal
rustup default stable
- run: ./tools/rusqlite-native.sh
fuzz:
name: Fuzz targets build (${{ matrix.sanitizer }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitizer: [address, memory]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: sudo apt-get install -y --no-install-recommends tcl
# Cargo resolves the sqlite-wasm-rs revision whose wrapper the targets build.
- run: |
rustup toolchain install stable --profile minimal
rustup default stable
- run: fuzz/build.sh "$RUNNER_TEMP/fuzz"
env:
SANITIZER: ${{ matrix.sanitizer }}