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
name: Test
on:
push:
branches:
pull_request:
branches:
jobs:
test:
strategy:
matrix:
rust:
os:
include:
- rust: stable
os: macos-latest
- rust: stable
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
# Cache is split into restore+save so the save key is content-addressable
# via the post-fetch hash of `.xx-hocon-version`. On a fresh checkout,
# `.xx-hocon-version` is gitignored and absent at restore time, so the
# restore step relies on `restore-keys` to match the most recent entry.
# (closes #101)
- name: Restore expected JSON cache
uses: actions/cache/restore@v5
with:
path: |
tests/testdata/expected
.xx-hocon-version
key: xx-hocon-expected-pending
restore-keys: xx-hocon-expected-
- name: Fetch expected JSON
run: make testdata
# Default `if: success()` — skip the save if `make testdata` failed so
# we don't write a partial/missing-pin cache under the empty-hash key
# (which would collapse to the constant `xx-hocon-expected-` and
# recreate the bug this PR is fixing). Copilot review thread.
- name: Save expected JSON cache
uses: actions/cache/save@v5
with:
path: |
tests/testdata/expected
.xx-hocon-version
key: xx-hocon-expected-${{ hashFiles('.xx-hocon-version') }}
- run: cargo test
if: matrix.rust == 'stable'
# MSRV: remove criterion dev-dependency before testing because
# criterion's transitive dep clap_lex requires edition 2024
- name: Remove bench deps for MSRV
if: matrix.rust != 'stable'
run: |
sed -i '/\[dev-dependencies\]/,/^\[/{/criterion/d}' Cargo.toml
sed -i '/\[\[bench\]\]/,/^$/d' Cargo.toml
- run: cargo test
if: matrix.rust != 'stable'
- run: cargo test --features serde
if: matrix.rust == 'stable'
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
# Cache is split into restore+save so the save key is content-addressable
# via the post-fetch hash of `.xx-hocon-version`. On a fresh checkout,
# `.xx-hocon-version` is gitignored and absent at restore time, so the
# restore step relies on `restore-keys` to match the most recent entry.
# (closes #101)
- name: Restore expected JSON cache
uses: actions/cache/restore@v5
with:
path: |
tests/testdata/expected
.xx-hocon-version
key: xx-hocon-expected-pending
restore-keys: xx-hocon-expected-
- name: Fetch expected JSON
run: make testdata
# Default `if: success()` — skip the save if `make testdata` failed so
# we don't write a partial/missing-pin cache under the empty-hash key
# (which would collapse to the constant `xx-hocon-expected-` and
# recreate the bug this PR is fixing). Copilot review thread.
- name: Save expected JSON cache
uses: actions/cache/save@v5
with:
path: |
tests/testdata/expected
.xx-hocon-version
key: xx-hocon-expected-${{ hashFiles('.xx-hocon-version') }}
- uses: taiki-e/install-action@cargo-llvm-cov
- run: cargo llvm-cov --features serde --lcov --output-path lcov.info
- uses: codecov/codecov-action@v5
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}
fail_ci_if_error: false