Skip to content

Commit

Permalink
Merge pull request #391 from Sharktheone/ci/all-targets
Browse files Browse the repository at this point in the history
CI: fix ci not running on all targets
  • Loading branch information
Sharktheone authored Feb 29, 2024
2 parents c1a498d + 051d4a2 commit 2215a0f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
- name: Build
run: cargo build --verbose
run: cargo build --verbose --all --all-features

test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
- name: Run tests
run: cargo test --verbose
run: cargo test --verbose --all --no-fail-fast --all-features --all-targets

clippy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
run: cargo clippy --all --tests -- -D warnings

fmt:
runs-on: ubuntu-latest
Expand All @@ -120,4 +120,4 @@ jobs:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-stable
- name: Run fmt
run: cargo fmt -- --check
run: cargo fmt --check --all
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ format: ## Fix formatting and clippy errors
test_unit:
source test-utils.sh ;\
section "Cargo test" ;\
cargo test --all --all-features
cargo test --verbose --all --no-fail-fast --all-features --all-targets

test_clippy:
source test-utils.sh ;\
Expand Down
16 changes: 14 additions & 2 deletions crates/gosub_html5/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4245,8 +4245,20 @@ impl<'chars> Html5Parser<'chars> {
match rel.as_str() {
"stylesheet" => {
let href = attributes.get("href").unwrap();
let base_url = self.document.get().location.clone().unwrap();
let css_url = base_url.join(href).unwrap();
let css_url = match Url::parse(href) {
Ok(url) => url,
Err(_err) => {
// Relative URL
if self.document.get().location.is_some() {
let binding = self.document.get();
let base_url = binding.location.as_ref().unwrap();
base_url.join(href).unwrap()
} else {
self.parse_error("link element without base url not supported yet");
return;
}
}
};
println!("loading external stylesheet: {}", css_url);

if let Some(stylesheet) = self.load_external_stylesheet(CssOrigin::Author, css_url)
Expand Down

0 comments on commit 2215a0f

Please sign in to comment.