Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ba0a499
test ci
cici0602 Sep 16, 2025
db981ab
chore: update GitHub Actions to latest versions
cici0602 Sep 16, 2025
77e18c5
ci: optimize configuration and fix several issues
cici0602 Sep 16, 2025
dcd9656
fix: resolve WebAssembly build issues in CI
cici0602 Sep 16, 2025
a9dbbeb
fix(ci): remove incorrect wasm backend config from non-wasm builds
cici0602 Sep 16, 2025
4ba045b
fix(ci): install clippy on all toolchains to prevent beta build failures
cici0602 Sep 16, 2025
1586a8f
fix: address clippy lints (io-other-error, mismatched-lifetime-syntaxes)
cici0602 Sep 16, 2025
f3bfeab
fix: resolve io_other_error clippy warnings
cici0602 Sep 16, 2025
9fa9f1d
style: fix code formatting issues for cargo fmt
cici0602 Sep 16, 2025
3338802
Replace deprecated smrpn action with boa-dev/criterion-compare-action…
cici0602 Sep 16, 2025
b813586
fix(github-actions): update cache configuration to use v4 and add res…
cici0602 Sep 16, 2025
0a7e92f
checkout v4->v5
cici0602 Sep 17, 2025
0e51b32
ci: use pull_request trigger so PR branch workflow (actions/cache@v4)…
cici0602 Sep 17, 2025
01d5b49
criterion-compare-action v1 -> master
cici0602 Sep 17, 2025
070cf1d
Added fetch-depth: 0 to checkout action to ensure all branches
cici0602 Sep 17, 2025
6df8c43
test
cici0602 Sep 17, 2025
3cced5d
fix binary already exists
cici0602 Sep 17, 2025
067fa10
pull_request -> pull_request_target
cici0602 Sep 17, 2025
e42aab1
test master/fix_ci benchmarks
cici0602 Sep 17, 2025
a1b5074
remove test comment
cici0602 Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup ruby
uses: ruby/setup-ruby@v1
Expand Down
36 changes: 24 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [beta, stable]
steps:
- name: Checkout Repository
uses: actions/checkout@master
uses: actions/checkout@v4
- name: Install Rust toolchain ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
override: true
- name: Install rustfmt and clippy
run: |
rustup component add rustfmt clippy || true
- name: Install wasm32-unknown-unknown for ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
Expand All @@ -31,25 +33,33 @@ jobs:
# Work around https://github.com/actions/cache/issues/403 by using GNU tar
# instead of BSD tar.
- name: Install GNU tar
if: matrix.os == 'macOS-latest'
if: matrix.os == 'macos-latest'
run: |
brew install gnu-tar
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
# Install GNU tar if not present, on macOS Homebrew may be in different locations
if ! command -v gtar >/dev/null 2>&1; then
brew install gnu-tar || true
fi
# Add GNU tar to PATH via GITHUB_ENV for actions that rely on gnu-tar
if [ -d "/usr/local/opt/gnu-tar/libexec/gnubin" ]; then
echo "PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
elif [ -d "/opt/homebrew/opt/gnu-tar/libexec/gnubin" ]; then
echo "PATH=/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
fi
- name: Cache cargo registry
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION }}
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION || github.run_id }}
- name: Cache cargo index
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION }}
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION || github.run_id }}
- name: Cache cargo build
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: target
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION }}
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION || github.run_id }}
- name: Release build async-std
uses: actions-rs/cargo@v1
with:
Expand All @@ -72,6 +82,8 @@ jobs:
args: --no-default-features --features runtime-tokio,cached,glob,ip,watcher,logging,incremental,explain
- name: Cargo Check Wasm
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: '--cfg getrandom_backend="wasm_js"'
with:
command: check
args: --target wasm32-unknown-unknown --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging,incremental
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -32,6 +32,6 @@ jobs:
cargo tarpaulin --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging,incremental,explain

- name: Upload to codecov.io
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
19 changes: 13 additions & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,31 @@ jobs:
name: run benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v5
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Cache cargo
uses: actions/cache@v2.1.4
uses: actions/cache@v4
with:
path: |
target
~/.cargo/git
~/.cargo/registry
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: smrpn/criterion-compare-action@move_to_actions
restore-keys: |
${{ runner.os }}-cargo-
- name: Install critcmp with force
run: cargo install critcmp --force
- uses: smrpn/criterion-compare-action@master
with:
cwd: benches
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rustdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ runtime-tokio = ["tokio/fs", "tokio/io-util"]
watcher = []

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
getrandom = { version = "0.3", features = ["wasm_js"] }
wasm-bindgen-test = "0.3.49"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
Expand Down
8 changes: 2 additions & 6 deletions src/adapter/file_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@
fs::File as file,
io::prelude::*,
io::{
BufReader as ioBufReader, Error as ioError, ErrorKind as ioErrorKind,

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (ubuntu-latest, beta)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (ubuntu-latest, beta)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (ubuntu-latest, stable)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (ubuntu-latest, stable)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (macos-latest, beta)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (macos-latest, beta)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (macos-latest, stable)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (macos-latest, stable)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (windows-latest, beta)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (windows-latest, beta)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (windows-latest, stable)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`

Check warning on line 14 in src/adapter/file_adapter.rs

View workflow job for this annotation

GitHub Actions / Auto Build CI (windows-latest, stable)

unused imports: `Error as ioError` and `ErrorKind as ioErrorKind`
},
path::Path as ioPath,
prelude::*,
};

#[cfg(feature = "runtime-tokio")]
use std::{
io::{Error as ioError, ErrorKind as ioErrorKind},
path::Path as ioPath,
};
use std::path::Path as ioPath;
#[cfg(feature = "runtime-tokio")]
use tokio::{
fs::File as file,
Expand Down Expand Up @@ -137,8 +134,7 @@

async fn save_policy(&mut self, m: &mut dyn Model) -> Result<()> {
if self.file_path.as_ref().as_os_str().is_empty() {
return Err(ioError::new(
ioErrorKind::Other,
return Err(std::io::Error::other(
"save policy failed, file path is empty",
)
.into());
Expand Down
22 changes: 9 additions & 13 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ use crate::Result;
#[cfg(feature = "runtime-async-std")]
use async_std::{
io::prelude::*,
io::{
BufReader as ioBufReader, Cursor as ioCursor, Error as ioError,
ErrorKind as ioErrorKind,
},
io::{BufReader as ioBufReader, Cursor as ioCursor},
};

#[cfg(all(feature = "runtime-async-std", not(target_arch = "wasm32")))]
use async_std::{fs::File as file, path::Path as ioPath};

#[cfg(feature = "runtime-tokio")]
use std::{io::Cursor as ioCursor, path::Path as ioPath};
use std::io::Cursor as ioCursor;
#[cfg(feature = "runtime-tokio")]
use tokio::io::{
AsyncBufReadExt, AsyncReadExt, BufReader as ioBufReader, Error as ioError,
ErrorKind as ioErrorKind,
};
use std::path::Path as ioPath;
#[cfg(feature = "runtime-tokio")]
use tokio::io::{AsyncBufReadExt, AsyncReadExt, BufReader as ioBufReader};

#[cfg(all(feature = "runtime-tokio", not(target_arch = "wasm32")))]
use tokio::fs::File as file;
Expand Down Expand Up @@ -128,10 +124,10 @@ impl Config {
.collect();

if option_val.len() != 2 {
return Err(ioError::new(
ioErrorKind::Other,
format!("parse content error, line={}", line),
)
return Err(std::io::Error::other(format!(
"parse content error, line={}",
line
))
.into());
}

Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub fn remove_comment(s: &str) -> String {
s.trim_end().to_owned()
}

pub fn escape_eval(m: &str) -> Cow<str> {
pub fn escape_eval(m: &str) -> Cow<'_, str> {
ESC_E.replace_all(m, "eval(escape_assertion(${1}))")
}

Expand Down
Loading