Skip to content

Commit 31757d0

Browse files
committed
Fix gh-action Smoke tests
Update entrypoint.sh Fix `Testing` workflow Add another $PATH in .github/enrtrypoint.sh Hopefully it will fix gh-action `Smoke tests` Fix example submodule not fetched Limit git-submodule only on `Smoke tests` Fix example submodule not fetched Fix example submodule not fetched Fix example submodule not fetched
1 parent b0d921b commit 31757d0

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

.github/entrypoint.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/bin/sh
22
set -e
33

4-
export PATH="$HOME/.cargo/bin:$PATH"
4+
mkdir --parents ${HOME}/.bin/
5+
export PATH="$HOME/.cargo/bin:${HOME}/.bin:$PATH"
56

7+
[ -z $WORKDIR ] || cd $WORKDIR
68
for cmd in "$@"; do
79
echo "Running '$cmd'..."
810
if sh -c "$cmd"; then
9-
[ -z "$BIN" ] && mv target/debug/$BIN $HOME/.cargo/bin/$BIN
1011
echo
1112
echo "Successfully ran '$cmd'"
1213
else

.github/main.workflow

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,24 @@ action "Test all rust project" {
4747
args = [
4848
"cargo install just",
4949
"just test",
50+
"mv target/debug/${BIN} ${HOME}/.bin/${BIN}",
5051
]
51-
env = { PWD = "/github/workspace", BIN = "scrap" }
52+
env = { BIN = "scrap" }
5253
}
5354

5455
action "Smoke tests" {
5556
needs = "Test all rust project"
56-
uses = "docker://node:buster-slim"
57+
uses = "docker://node:buster"
5758
runs = "./.github/entrypoint.sh"
5859
args = [
60+
"git submodule update --init --recursive",
5961
"npm install",
6062
"scrap generate src/${filestem}.scl --format xstate --as typescript > src/fsm/${filestem}.ts",
6163
"scrap generate src/${filestem}.scl --format xstate --as javascript >> src/fsm/${filestem}.ts",
6264
"npx tsc --build",
6365
"node dist/index.js",
6466
]
65-
env = { PWD = "/github/workspace", filestem = "light" }
67+
env = { WORKDIR = "examples/xstate/nodejs", filestem = "light" }
6668
}
6769

6870
action "Perf cargo" {
@@ -84,7 +86,6 @@ action "Build Release cli as musl" {
8486
"rustup target add x86_64-unknown-linux-musl",
8587
"apt-get update && apt-get install -y musl-tools",
8688
"cargo build --target x86_64-unknown-linux-musl --release --bin ${BIN}",
87-
"mkdir --parents ${HOME}/.bin/",
8889
"mv target/x86_64-unknown-linux-musl/release/${BIN} ${HOME}/.bin/${BIN}",
8990
]
9091
env = { BIN = "scrap" }
@@ -95,10 +96,10 @@ action "Perf CLI release" {
9596
uses = "docker://python:alpine"
9697
runs = "./.github/profiler.sh"
9798
args = [
98-
"${HOME}/.bin/scrap code examples/simple.scl --format xstate",
99-
"${HOME}/.bin/scrap code examples/simple.scl --format xstate --stream",
100-
"${HOME}/.bin/scrap code examples/simple.scl --format smcat",
101-
"${HOME}/.bin/scrap code examples/simple.scl --format smcat --stream",
99+
"scrap code examples/simple.scl --format xstate",
100+
"scrap code examples/simple.scl --format xstate --stream",
101+
"scrap code examples/simple.scl --format smcat",
102+
"scrap code examples/simple.scl --format smcat --stream",
102103
],
103104
env = { PREPARE = "./scripts/gensample.py 1000 > examples/simple.scl" }
104105
}

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "examples/xstate/nodejs"]
22
path = examples/xstate/nodejs
3-
url = git@github.com:DrSensor/nodejs-scdlang_xstate.git
3+
url = https://github.com/DrSensor/nodejs-scdlang_xstate.git

0 commit comments

Comments
 (0)