Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 16 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: install `just`
run: sudo snap install --edge --classic just

- uses: cargo-bins/cargo-binstall@main
- uses: taiki-e/install-action@v2
with:
tool: just,sqlx-cli

- name: restore build & cargo cache
uses: Swatinem/rust-cache@v2
Expand All @@ -33,9 +32,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: install SQLX CLI
run: cargo binstall sqlx-cli

- name: run sqlx migration up & down
run: |
just sqlx-migrate-run \
Expand All @@ -51,8 +47,9 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: install `just`
run: sudo snap install --edge --classic just
- uses: taiki-e/install-action@v2
with:
tool: just

- name: restore build & cargo cache
uses: Swatinem/rust-cache@v2
Expand All @@ -77,8 +74,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: install `just`
run: sudo snap install --edge --classic just
- uses: taiki-e/install-action@v2
with:
tool: just

- name: Run GUI tests
run: just run-gui-tests
Expand All @@ -94,18 +92,16 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: install `just`
run: sudo snap install --edge --classic just
- uses: taiki-e/install-action@v2
with:
tool: just,fd-find,cargo-machete

- name: restore build & cargo cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ env.RUST_CACHE_KEY }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- run: just lint
- run: just lint lint-dependencies

lint-js:
name: js linters
Expand All @@ -115,8 +111,9 @@ jobs:

- uses: denoland/setup-deno@v2

- name: install `just`
run: sudo snap install --edge --classic just
- uses: taiki-e/install-action@v2
with:
tool: just

- run: just lint-js

Expand Down
33 changes: 2 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ strum = { version = "0.27.0", features = ["derive"] }
lol_html = "2.0.0"
font-awesome-as-a-crate = { path = "crates/font-awesome-as-a-crate" }
dashmap = "6.0.0"
string_cache = "0.9.0"
zip = {version = "6.0.0", default-features = false, features = ["bzip2"]}
bzip2 = "0.6.0"
getrandom = "0.3.1"
Expand All @@ -75,8 +74,6 @@ aws-config = { version = "1.0.0", default-features = false, features = ["rt-toki
aws-sdk-s3 = "1.3.0"
aws-smithy-types-convert = { version = "0.60.0", features = ["convert-chrono"] }
http = "1.0.0"
uuid = { version = "1.1.2", features = ["v4"]}


# Data serialization and deserialization
serde = { version = "1.0", features = ["derive"] }
Expand Down Expand Up @@ -125,13 +122,15 @@ pretty_assertions = "1.4.0"
[build-dependencies]
time = "0.3"
md5 = "0.8.0"
string_cache_codegen = "0.6.1"
phf_codegen = "0.13"
walkdir = "2"
anyhow = { version = "1.0.42", features = ["backtrace"] }
grass = { version = "0.13.1", default-features = false }
syntect = { version = "5.0.0", default-features = false, features = ["parsing", "dump-create", "yaml-load", "regex-onig"] }

[package.metadata.cargo-machete]
ignored = ["phf"]

[[bench]]
name = "compression"
harness = false
Expand Down
19 changes: 0 additions & 19 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ fn main() -> Result<()> {
let mut etag_map: ETagMap = ETagMap::new();

compile_sass(out_dir, &mut etag_map)?;
write_known_targets(out_dir)?;
compile_syntax(out_dir).context("could not compile syntax files")?;
calculate_static_etags(&mut etag_map)?;

Expand Down Expand Up @@ -226,24 +225,6 @@ fn calculate_static_etags(etag_map: &mut ETagMap) -> Result<()> {
Ok(())
}

fn write_known_targets(out_dir: &Path) -> Result<()> {
use std::io::BufRead;

let targets: Vec<String> = std::process::Command::new("rustc")
.args(["--print", "target-list"])
.output()?
.stdout
.lines()
.filter(|s| s.as_ref().map_or(true, |s| !s.is_empty()))
.collect::<std::io::Result<_>>()?;

string_cache_codegen::AtomType::new("target::TargetAtom", "target_atom!")
.atoms(&targets)
.write_to_file(&out_dir.join("target_atom.rs"))?;

Ok(())
}

fn compile_syntax(out_dir: &Path) -> Result<()> {
use syntect::{
dumps::dump_to_uncompressed_file,
Expand Down
14 changes: 13 additions & 1 deletion justfiles/testing.just
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ clippy-fix:

# run all linters, for local development & CI
[group('testing')]
lint: format
lint: format lint-dependencies
#!/usr/bin/env bash
set -euo pipefail

Expand All @@ -64,6 +64,18 @@ lint: format
just clippy-fix
fi

[group('testing')]
lint-dependencies:
# check unused deps with cargo machete is fast,
# but has many false positives.
# While it can also recurse into subdirs, it would
# also stumble onto our broken crates in `/tests/crates/*`,
# where I also don't want to add machete-metadata.
@fd \
--glob 'Cargo.toml' \
--type file \
--exclude tests \
-X cargo machete {}

[group('testing')]
lint-js *args:
Expand Down
7 changes: 0 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ mod test;
pub mod utils;
mod web;

#[allow(dead_code)]
mod target {
//! [`crate::target::TargetAtom`] is an interned string type for rustc targets, such as
//! `x86_64-unknown-linux-gnu`. See the [`string_cache`] docs for usage examples.
include!(concat!(env!("OUT_DIR"), "/target_atom.rs"));
}

use web::page::GlobalAlert;

// Warning message shown in the navigation bar of every page. Set to `None` to hide it.
Expand Down
Loading