Skip to content

Commit

Permalink
ci: enable aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
liuq19 committed Jan 23, 2025
1 parent 9f8c413 commit 432ea65
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 43 deletions.
74 changes: 36 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,58 @@ env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always

jobs:
jobs:
test-stable:
name: Rust stable ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
name: Rust stable ubuntu-latest
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v1
- run: ./scripts/test.sh

test-stable-self:
name: Rust stable on self-hosted
runs-on: [self-hosted]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v1
- run: ./scripts/test.sh

test-nightly:
name: Rust nightly ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
test-stable-hosted:
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
os:
- [self-hosted, Linux, X64]
- [self-hosted, Linux, ARM64]
name: Rust stable
runs-on: ${{matrix.os}}
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v1
- uses: dtolnay/rust-toolchain@stable
- run: ./scripts/test.sh

test-nightlye-self:
name: Rust nightly on self-hosted
runs-on: [self-hosted]
test-nightly:
name: Rust nightly ubuntu-latest
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v1
- run: ./scripts/test.sh
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: ./scripts/test.sh

clippy_lint:
name: Format check ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
test-nightly-hosted:
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
fail-fast: false
matrix:
os:
- [self-hosted, Linux, X64]
- [self-hosted, Linux, ARM64]
name: Rust nightly ${{matrix.os}}
runs-on: ${{matrix.os}}
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: ./scripts/test.sh

clippy_lint:
name: Format check
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
Expand All @@ -73,7 +71,7 @@ jobs:
cargo fmt -- --check
sanitize:
runs-on: [self-hosted, X64]
runs-on: [self-hosted, Linux, X64]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -86,7 +84,7 @@ jobs:
run: ./scripts/sanitize.sh

fuzz:
runs-on: [self-hosted, X64]
runs-on: [self-hosted, Linux, X64]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permissions:

jobs:
dependency-review:
runs-on: [self-hosted, X64]
runs-on: [self-hosted, X64, macos-latest]
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions src/lazyvalue/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
error::Result,
input::{JsonInput, JsonSlice},
lazyvalue::LazyValue,
parser::{Parser, DEFAULT_KEY_BUF_CAPACITY},
parser::{Pair, Parser, DEFAULT_KEY_BUF_CAPACITY},
reader::{Read, Reader},
};
/// A lazied iterator for JSON object text. It will parse the JSON when iterating.
Expand Down Expand Up @@ -119,7 +119,7 @@ impl<'de> ObjectJsonIter<'de> {
.parse_entry_lazy(&mut self.strbuf, &mut self.first, self.skip_strict)
{
Ok(ret) => {
if let Some((key, val, status)) = ret {
if let Some(Pair { key, val, status }) = ret {
let val = self.parser.read.slice_ref(val);
Some(Ok(LazyValue::new(val, status.into())).map(|v| (key, v)))
} else {
Expand Down
15 changes: 13 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ fn skip_container_loop(
None
}

pub(crate) struct Pair<'de> {
pub key: Cow<'de, str>,
pub val: &'de [u8],
pub status: ParseStatus,
}

pub(crate) struct Parser<R> {
pub(crate) read: R,
error_index: usize, // mark the error position
Expand Down Expand Up @@ -532,7 +538,7 @@ where
strbuf: &mut Vec<u8>,
first: &mut bool,
check: bool,
) -> Result<Option<(Cow<'de, str>, &'de [u8], ParseStatus)>> {
) -> Result<Option<Pair<'de>>> {
if *first && self.skip_space() != Some(b'{') {
return perr!(self, ExpectedObjectStart);
}
Expand All @@ -554,7 +560,12 @@ where
} else {
self.skip_one_unchecked()
}?;
Ok(Some((parsed.into(), raw, status)))

Ok(Some(Pair {
key: parsed.into(),
val: raw,
status,
}))
}

// Not use non-recurse version here, because it maybe 5% slower than recurse version.
Expand Down

0 comments on commit 432ea65

Please sign in to comment.