Add the changelog to the site, and put the demo inside its header and footer #269
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: "1.96.1" | |
| - name: version info | |
| run: rustc --version; cargo --version; | |
| # `wasi-exports` is in the set so the WebAssembly C ABI is compiled and | |
| # its tests run here rather than only on the target. See | |
| # crates/lib/src/wasi_exports.rs. | |
| - name: Run all tests | |
| run: cargo test --features=macro,wasi-exports | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: "1.96.1" | |
| - run: | | |
| rustup component add rustfmt | |
| cargo fmt --all -- --check | |
| # Clippy runs on BOTH the MSRV and current stable, and both gate. | |
| # | |
| # Pinning the lint gate to the MSRV alone made CI blind to every lint added | |
| # after it: a contributor on stable saw sixteen errors that CI reported as | |
| # clean. The MSRV run still matters -- it catches code that only compiles on | |
| # a newer compiler -- but it cannot be the whole gate, because lints are how | |
| # the project finds out its own code has drifted. | |
| # | |
| # The cost is that a new stable release can turn CI red without anything in | |
| # this repository changing. That is the intended behaviour: it is the signal | |
| # arriving on time rather than months later. | |
| clippy: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| toolchain: ["1.96.1", "stable"] | |
| name: clippy (${{ matrix.toolchain }}) | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| components: clippy | |
| - name: version info | |
| run: cargo clippy --version | |
| - run: cargo clippy --features=macro,wasi-exports --all-targets -- -D warnings | |
| # The wasm32-wasip1 builds, run rather than only built: the command module | |
| # under wasmtime, and the library module through a host that calls its | |
| # exports. | |
| # | |
| # This gates. It is fast and deterministic, and the target has no other | |
| # coverage at all: nothing else in this workflow would notice if a filesystem | |
| # call started failing under WASI, because every one of them compiles either | |
| # way. The browser package shipped a module with no compiler in it for two | |
| # releases for want of a check like this one. | |
| # | |
| # See specs/docs/features/13-wasm-wasi.md. | |
| wasi: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: "1.96.1" | |
| targets: wasm32-wasip1 | |
| - name: Install wasmtime | |
| run: | | |
| curl -sSL -o wasmtime.tar.xz \ | |
| https://github.com/bytecodealliance/wasmtime/releases/download/v48.0.1/wasmtime-v48.0.1-x86_64-linux.tar.xz | |
| tar xf wasmtime.tar.xz | |
| echo "WASMTIME=$PWD/wasmtime-v48.0.1-x86_64-linux/wasmtime" >> "$GITHUB_ENV" | |
| # The library check is a Node host, and it uses `node:wasi`. | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: "24" | |
| - name: Build for wasm32-wasip1 | |
| run: cargo build --release -p accent-sass --target wasm32-wasip1 --features commandline | |
| - name: Compile under wasmtime | |
| run: .github/scripts/wasi-smoke.sh | |
| # The other shape of the target: a reactor the host instantiates once | |
| # and calls into, built without the command-line interface and with the | |
| # size profile. It is the artifact a plugin host embeds, and it has its | |
| # own ABI, so it needs its own check -- the command module passing says | |
| # nothing about whether the exports still work. | |
| - name: Build the library artifact | |
| run: | | |
| cargo build --profile small -p accent-sass --target wasm32-wasip1 \ | |
| --no-default-features --features wasi-exports,random | |
| - name: Call the library artifact from a host | |
| run: node .github/scripts/wasi-lib-smoke.mjs | |
| # Size is the point of the separate profile, so it is reported rather | |
| # than assumed. A jump here is worth looking at even though nothing | |
| # gates on it. The table goes to the log as well as the run summary, | |
| # because the summary is only readable in the web interface. | |
| - name: Report artifact sizes | |
| run: | | |
| { | |
| echo "### wasm32-wasip1 artifacts" | |
| echo | |
| echo "| artifact | bytes | gzipped |" | |
| echo "|---|---:|---:|" | |
| for f in target/wasm32-wasip1/release/accent-sass.wasm \ | |
| target/wasm32-wasip1/small/accent_sass.wasm; do | |
| echo "| \`$f\` | $(stat -c%s "$f") | $(gzip -9 -c "$f" | wc -c) |" | |
| done | |
| } | tee -a "$GITHUB_STEP_SUMMARY" | |
| # Compiles Bootstrap with both engines and reports how far apart they are. | |
| # Advisory: this fork does not reach exact byte equality across a whole | |
| # framework -- what remains is accent-sass's own rule-grouping behaviour, which | |
| # predates this fork -- so the job prints the delta rather than gating. | |
| bootstrap: | |
| continue-on-error: true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - name: Build | |
| run: cargo build | |
| # The version this fork targets; see README.md. The colour pipeline | |
| # deliberately matches 1.79+ semantics, so comparing against the old | |
| # 1.54.3 binary reports differences that are intended. | |
| - name: Install dart-sass 1.104.1 | |
| run: | | |
| wget -q https://github.com/sass/dart-sass/releases/download/1.104.1/dart-sass-1.104.1-linux-x64.tar.gz | |
| tar -xzf dart-sass-1.104.1-linux-x64.tar.gz | |
| - name: Install bootstrap | |
| run: git clone --depth=1 --branch v5.0.2 https://github.com/twbs/bootstrap.git | |
| - name: Compare output | |
| run: | | |
| ./target/debug/accent-sass bootstrap/scss/bootstrap.scss > accent-sass-output.css | |
| ./dart-sass/sass --quiet bootstrap/scss/bootstrap.scss > dart-sass-output.css | |
| differing=$(diff accent-sass-output.css dart-sass-output.css | grep -c '^[<>]' || true) | |
| colours=$(diff accent-sass-output.css dart-sass-output.css \ | |
| | grep '^[<>]' | grep -cE 'rgb\(|hsl\(|#[0-9a-fA-F]{3,8}\b' || true) | |
| { | |
| echo "### Bootstrap 5.0.2 vs dart-sass 1.104.1" | |
| echo | |
| echo "- differing lines: $differing" | |
| echo "- of which carry a colour value: $colours" | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| echo "differing lines: $differing (colour-bearing: $colours)" | |
| diff accent-sass-output.css dart-sass-output.css || true | |
| # A colour-value difference is a real regression; structural | |
| # grouping differences are known and tracked. | |
| if [ "$colours" -ne 0 ]; then | |
| echo "::error::colour values diverge from dart-sass" | |
| exit 1 | |
| fi | |
| # Compiles a corpus of real-world frameworks -- Bulma, Pico, Foundation and | |
| # USWDS -- with both engines and compares the output. These exercise the | |
| # modern colour APIs, so this is the regression guard for the colour | |
| # pipeline: a difference in a colour value fails the job. Rule grouping and | |
| # ordering differences are reported but tolerated. See | |
| # .github/scripts/frameworks.sh. | |
| frameworks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: "20" | |
| - name: Build binary | |
| run: cargo build --release | |
| - name: Install dart-sass 1.104.1 | |
| run: | | |
| wget -q https://github.com/sass/dart-sass/releases/download/1.104.1/dart-sass-1.104.1-linux-x64.tar.gz | |
| tar -xzf dart-sass-1.104.1-linux-x64.tar.gz | |
| - name: Install lightningcss | |
| run: npm install -g lightningcss-cli | |
| - name: Compare against dart-sass | |
| env: | |
| ACCENT_SASS: ./target/release/accent-sass | |
| SASS: ./dart-sass/sass | |
| NORMALISE: lightningcss | |
| run: .github/scripts/frameworks.sh | |
| # Conformance against the official Sass spec suite (the `sass-spec` | |
| # submodule). Advisory only -- `continue-on-error` keeps it from gating a | |
| # merge, because most failures are the CSS Color 4 colour spaces this fork | |
| # does not implement. See the results table in README.md. | |
| # | |
| # To run this on the LAN runner instead, swap `runs-on` for | |
| # `[self-hosted, linux, x64, rust]`. That needs a runner with those labels | |
| # registered against this repository; without one the job sits queued | |
| # indefinitely rather than failing. | |
| sass-spec: | |
| continue-on-error: true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: true | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: "20" | |
| - name: version info | |
| run: rustc --version; cargo --version; node --version | |
| - name: Build binary | |
| run: cargo build --release | |
| - name: Install spec runner | |
| working-directory: sass-spec | |
| run: npm install --no-audit --no-fund | |
| - name: Run Sass spec | |
| working-directory: sass-spec | |
| run: | | |
| # The runner exits non-zero whenever any test fails, which is | |
| # expected here; the tallies are the output we want. | |
| npm run sass-spec -- \ | |
| --impl=dart-sass \ | |
| --command '../target/release/accent-sass' \ | |
| --trim-errors --ignore-warning-diffs --ignore-error-diffs \ | |
| > spec-results.txt 2>&1 || true | |
| tail -n 40 spec-results.txt | |
| - name: Publish tallies | |
| working-directory: sass-spec | |
| run: | | |
| { | |
| echo "### Sass spec conformance" | |
| echo | |
| echo '```' | |
| grep -a 'runs,' spec-results.txt | tail -n 1 | |
| echo '```' | |
| } >> "$GITHUB_STEP_SUMMARY" |