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
32 changes: 0 additions & 32 deletions .github/workflows/cli.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/lib.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Release CLI
on:
release:
types: [created]
types: [published]

jobs:
build:
Expand All @@ -21,7 +21,7 @@ jobs:
target: aarch64-unknown-linux-musl
artifact: svg2gcode-linux-aarch64
- name: macOS x64
runner: macos-15-intel
runner: macos-26-intel
target: x86_64-apple-darwin
artifact: svg2gcode-macos-x86_64
- name: macOS arm64
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
release:
name: Upload release assets
needs: build
runs-on: ubuntu-latest
runs-on: ubuntu-slim
permissions:
contents: write
steps:
Expand Down
43 changes: 32 additions & 11 deletions .github/workflows/web-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
name: Deploy svg2gcode-web
on:
workflow_run:
branches: [main]
workflows: [Check svg2gcode-web]
types: [completed]
release:
types: [published]
workflow_dispatch:
inputs:
ref:
description: 'Commit hash, tag, or branch to deploy'
required: true
default: 'main'
type: string

env:
CARGO_TERM_COLOR: always

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.ref || github.ref }}
submodules: 'true'
- uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -27,10 +41,17 @@ jobs:
run: |
cd web
trunk build --release --public-url https://sameer.github.io/svg2gcode/

- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
- name: Upload to Github Pages
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ github.workspace }}/web/dist
path: ${{ github.workspace }}/web/dist
deploy:
environment:
name: github-pages
url: ${{ steps.deploypages.outputs.page_url }}
runs-on: ubuntu-slim
needs: build
steps:
- name: Deploy to GitHub Pages
id: deploypages
uses: actions/deploy-pages@v4
12 changes: 1 addition & 11 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Get stable release date
id: stable-date
run: echo "date=$(curl -s https://static.rust-lang.org/dist/channel-rust-stable.toml | grep '^date' -m1 | cut -d'"' -f2)" >> $GITHUB_OUTPUT
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-${{ steps.stable-date.outputs.date }}
components: rustfmt
cache-all-crates: true
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: clippy
- name: Fmt
run: cargo +nightly-${{ steps.stable-date.outputs.date }} fmt --check -p svg2gcode-web
- name: Clippy
run: cargo clippy -p svg2gcode-web --target wasm32-unknown-unknown -- -D warnings
- name: Check
run: cargo check -p svg2gcode-web --target wasm32-unknown-unknown
47 changes: 47 additions & 0 deletions .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Workspace crate checks

on:
push:
branches: [main]
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
- name: Get stable release date
id: stable-date
run: echo "date=$(curl -s https://static.rust-lang.org/dist/channel-rust-stable.toml | grep '^date' -m1 | cut -d'"' -f2)" >> $GITHUB_OUTPUT
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-${{ steps.stable-date.outputs.date }}
components: clippy, rustfmt
- uses: taiki-e/install-action@cargo-hack
- name: Fmt
run: cargo +nightly-${{ steps.stable-date.outputs.date }} fmt --check
- name: Clippy
run: cargo +nightly-${{ steps.stable-date.outputs.date }} hack clippy --workspace --feature-powerset --tests -- -D warnings
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-hack
- name: Build
run: cargo hack build --workspace --feature-powerset
- name: Test
run: cargo hack test --workspace --feature-powerset
2 changes: 1 addition & 1 deletion g_code/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn assert_close(left: Vec<Token<'_>>, right: Vec<Token<'_>>) {
let mut code = String::new();
::g_code::emit::format_gcode_fmt(left.iter(), FormatOptions::default(), &mut code).unwrap();
assert_eq!(left.len(), right.len(), "{code}");
for (i, pair) in left.into_iter().zip(right.into_iter()).enumerate() {
for (i, pair) in left.into_iter().zip(right).enumerate() {
match pair {
(Token::Field(l), Token::Field(r)) => {
assert_eq!(l.letters, r.letters);
Expand Down
2 changes: 0 additions & 2 deletions star/src/turtle/elements/image_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ pub fn transform_image(
// During non-aligned rotation, the corners need to be transparent
image = add_alpha_channel(image);



let scale_x = image_to_final.transform_vector(vector(1.0, 0.0)).length();
let scale_y = image_to_final.transform_vector(vector(0.0, 1.0)).length();

Expand Down
10 changes: 5 additions & 5 deletions web/src/forms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ pub fn import_export_modal() -> Html {
&gloo_file::File::from(file),
move |res| {
let res = res
.map_err(|err| format!("Error reading {}: {}", &filename, err))
.map_err(|err| format!("Error reading {}: {}", filename, err))
.and_then(|bytes| {
serde_json::from_slice::<Settings>(&bytes)
.map_err(|err| format!("Error parsing {}: {}", &filename, err))
.map_err(|err| format!("Error parsing {}: {}", filename, err))
});

match res {
Expand Down Expand Up @@ -429,7 +429,7 @@ pub fn svg_form() -> Html {
)
.err()
{
Err(format!("Error parsing {}: {}", &filename, err))
Err(format!("Error parsing {}: {}", filename, err))
} else {
Ok(Svg {
content: text,
Expand Down Expand Up @@ -517,7 +517,7 @@ pub fn svg_form() -> Html {
{
url_input_parsed.set(Some(Err(format!(
"Error parsing {}: {}",
&response_url, err
response_url, err
))));
} else {
app.reduce_mut(|app| {
Expand All @@ -532,7 +532,7 @@ pub fn svg_form() -> Html {
Err(err) => {
url_input_parsed.set(Some(Err(format!(
"Error fetching {}: {:?}",
&request_url,
request_url,
err.dyn_into::<TypeError>().unwrap().message()
))));
}
Expand Down
Loading