blob: ad4403e73b2b830a914e285a2424185f716114bc (
plain) (
blame)
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
|
name: CI
on:
push:
pull_request:
workflow_dispatch:
workflow_call:
permissions:
contents: read
jobs:
test:
name: Test (${{ matrix.os }}, Rust ${{ matrix.rust }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
persist-credentials: false
- name: Install Rust
run: rustup toolchain install ${{ matrix.rust }} --profile minimal
- name: Test default dependencies
run: cargo +${{ matrix.rust }} test --locked
- name: Test arbitrary-precision JSON compatibility
run: cargo +${{ matrix.rust }} test --locked --features serde_json/arbitrary_precision
- name: Test release build
run: cargo +${{ matrix.rust }} test --release --locked
quality:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
persist-credentials: false
- name: Install Rust tools
run: rustup toolchain install stable --profile minimal --component rustfmt --component clippy
- name: Test release automation
run: python3 -B -m unittest discover -s scripts -p 'test_*.py'
- name: Check formatting
run: cargo +stable fmt --all -- --check
- name: Check lints
run: cargo +stable clippy --all-targets --locked -- -D warnings
- name: Check feature compatibility lints
run: cargo +stable clippy --all-targets --locked --features serde_json/arbitrary_precision -- -D warnings
- name: Verify package
run: cargo +stable package --locked
- name: Test packaged crate
shell: bash
run: |
package=$(cargo +stable metadata --no-deps --format-version 1 | python3 -c 'import json, sys; p = json.load(sys.stdin)["packages"][0]; print(p["name"] + "-" + p["version"])')
cargo +stable test --locked --manifest-path "target/package/$package/Cargo.toml"
|