Skip to content

Commit

Permalink
Use cargo-component
Browse files Browse the repository at this point in the history
  • Loading branch information
ursm committed Aug 26, 2024
1 parent d511239 commit 0c45653
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
push:

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: cargo test

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: cargo clippy

format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: cargo fmt --check
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ on:
release:
types: [published]

env:
CARGO_TERM_COLOR: always

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- run: rustup target add wasm32-wasi
- run: cargo build --release
- run: cargo install cargo-component
- run: cargo component build --release

- uses: softprops/action-gh-release@v2
with:
files: target/wasm32-wasi/release/zellij-foreman.wasm
files: target/wasm32-wasip1/release/zellij-foreman.wasm
fail_on_unmatched_files: true
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ zellij-tile = "0.40.1"

[profile.release]
codegen-units = 1
opt-level = "s"
debug = false
strip = true
lto = true
strip = "symbols"
15 changes: 15 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,18 @@ fn parse_procfile(procfile: &str) -> Vec<(&str, &str)> {
(name, command)
}).collect()
}

#[test]
fn test_parse_procfile() {
let procfile = r#"
web: npm start
api: npm run api
# comment one
comment two
"#;

let entries = parse_procfile(procfile);

assert_eq!(entries, vec![("web", "npm start"), ("api", "npm run api"),]);
}

0 comments on commit 0c45653

Please sign in to comment.