@@ -42,71 +42,32 @@ jobs:
4242 steps :
4343 - uses : actions/checkout@v6
4444
45- - name : Probe spore compiler access
46- id : spore-source
47- env :
48- SPORE_CHECKOUT_TOKEN : ${{ secrets.SPORE_REPO_READ_TOKEN != '' && secrets.SPORE_REPO_READ_TOKEN || github.token }}
49- HAS_SPORE_REPO_READ_TOKEN : ${{ secrets.SPORE_REPO_READ_TOKEN != '' }}
50- run : |
51- echo "::add-mask::$SPORE_CHECKOUT_TOKEN"
52- api_url="https://api.github.com/repos/${SPORE_REPOSITORY}/git/commits/${SPORE_REF}"
53- status="$(curl --silent --show-error --output /dev/null --write-out '%{http_code}' \
54- -H "Authorization: Bearer ${SPORE_CHECKOUT_TOKEN}" \
55- -H 'Accept: application/vnd.github+json' \
56- "${api_url}")"
57-
58- if [ "${status}" = "200" ]; then
59- echo "available=true" >> "$GITHUB_OUTPUT"
60- exit 0
61- fi
62-
63- echo "available=false" >> "$GITHUB_OUTPUT"
64-
65- if [ "${HAS_SPORE_REPO_READ_TOKEN}" = "true" ]; then
66- echo "::error::Configured secrets.SPORE_REPO_READ_TOKEN cannot read ${SPORE_REPOSITORY}@${SPORE_REF} (HTTP ${status})."
67- exit 1
68- fi
69-
70- if [ "${status}" != "404" ]; then
71- echo "::error::Unexpected response probing ${SPORE_REPOSITORY}@${SPORE_REF} without secrets.SPORE_REPO_READ_TOKEN (HTTP ${status})."
72- exit 1
73- fi
74-
75- echo "::warning::Skipping compiler-backed Spore checks because github.token cannot read private ${SPORE_REPOSITORY}. Configure secrets.SPORE_REPO_READ_TOKEN with read access to enable the full suite."
76-
7745 - uses : actions/checkout@v6
78- if : steps.spore-source.outputs.available == 'true'
7946 with :
8047 repository : ${{ env.SPORE_REPOSITORY }}
8148 ref : ${{ env.SPORE_REF }}
8249 path : _spore
83- token : ${{ secrets.SPORE_REPO_READ_TOKEN != '' && secrets.SPORE_REPO_READ_TOKEN || github.token }}
50+ token : ${{ secrets.SPORE_REPO_READ_TOKEN }}
8451
8552 - uses : dtolnay/rust-toolchain@stable
86- if : steps.spore-source.outputs.available == 'true'
8753 with :
8854 toolchain : stable
8955
9056 - uses : Swatinem/rust-cache@v2
91- if : steps.spore-source.outputs.available == 'true'
9257 with :
9358 workspaces : _spore
9459
9560 - name : Build spore compiler
96- if : steps.spore-source.outputs.available == 'true'
9761 run : cargo build --release --manifest-path _spore/Cargo.toml --bin spore
9862
9963 - name : Format Spore files
100- if : steps.spore-source.outputs.available == 'true'
10164 run : |
10265 # `src/host.sp` is a legacy compatibility shim; validate package-backed behavior
10366 # via the example and platform modules rather than standalone file-mode checks.
10467 # Standalone file examples
10568 find examples -maxdepth 1 -name '*.sp' -type f | sort | xargs _spore/target/release/spore format
10669 # Project-mode examples (format their src files)
107- if [ -d examples/hello-app/src ]; then
108- find examples/hello-app/src -name '*.sp' -type f | sort | xargs _spore/target/release/spore format
109- fi
70+ find examples/hello-app/src -name '*.sp' -type f | sort | xargs _spore/target/release/spore format
11071 # Platform API modules
11172 find src/basic_cli -name '*.sp' -type f | sort | xargs _spore/target/release/spore format
11273 # Check tests if they exist
11677 git diff --exit-code
11778
11879 - name : Check Spore files
119- if : steps.spore-source.outputs.available == 'true'
12080 run : |
12181 # `src/host.sp` is a legacy compatibility shim; validate package-backed behavior
12282 # via the example and platform modules rather than standalone file-mode checks.
@@ -125,20 +85,17 @@ jobs:
12585 # Platform API modules
12686 find src/basic_cli -name '*.sp' -type f | sort | xargs -n 1 _spore/target/release/spore check
12787 # Project-mode examples: validate with spore check
128- if [ -d examples/hello-app ]; then
129- (
130- cd examples/hello-app
131- echo "✓ Checking project-mode example src/main.sp"
132- ../../_spore/target/release/spore check src/main.sp
133- )
134- fi
88+ (
89+ cd examples/hello-app
90+ echo "✓ Checking project-mode example src/main.sp"
91+ ../../_spore/target/release/spore check src/main.sp
92+ )
13593 # Check tests if they exist
13694 if [ -d tests ]; then
13795 find tests -name '*.sp' -type f | sort | xargs -n 1 _spore/target/release/spore check
13896 fi
13997
14098 - name : Build Spore files
141- if : steps.spore-source.outputs.available == 'true'
14299 run : |
143100 # `src/host.sp` is a legacy compatibility shim; validate package-backed behavior
144101 # via the example and platform modules rather than standalone file-mode builds.
@@ -147,59 +104,31 @@ jobs:
147104 # Platform API modules
148105 find src/basic_cli -name '*.sp' -type f | sort | xargs -n 1 _spore/target/release/spore build
149106 # Project-mode examples: validate with spore build
150- if [ -d examples/hello-app ]; then
151- (
152- cd examples/hello-app
153- echo "✓ Building project-mode example src/main.sp"
154- ../../_spore/target/release/spore build src/main.sp
155- )
156- fi
107+ (
108+ cd examples/hello-app
109+ echo "✓ Building project-mode example src/main.sp"
110+ ../../_spore/target/release/spore build src/main.sp
111+ )
157112 # Check tests if they exist
158113 if [ -d tests ]; then
159114 find tests -name '*.sp' -type f | sort | xargs -n 1 _spore/target/release/spore build
160115 fi
161116
162117 - name : Run standalone hello example
163- if : steps.spore-source.outputs.available == 'true'
164118 run : _spore/target/release/spore run examples/hello.sp
165119
166120 - name : Run project-mode hello-app example
167- if : steps.spore-source.outputs.available == 'true'
168121 run : |
169- if [ -d examples/hello-app ]; then
170- (
171- cd examples/hello-app
172- echo "✓ Running project-mode example src/main.sp"
173- ../../_spore/target/release/spore run src/main.sp
174- )
175- fi
122+ (
123+ cd examples/hello-app
124+ echo "✓ Running project-mode example src/main.sp"
125+ ../../_spore/target/release/spore run src/main.sp
126+ )
176127
177128 - name : Run Spore spec tests
178- if : steps.spore-source.outputs.available == 'true'
179129 run : |
180130 if [ ! -d tests ]; then
181131 echo "No Spore spec tests yet; skipping spore test."
182132 exit 0
183133 fi
184134 find tests -name '*.sp' -type f | sort | xargs -r -n 1 _spore/target/release/spore test
185-
186- - name : Validate Spore package wiring fallback
187- if : steps.spore-source.outputs.available != 'true'
188- run : |
189- python - <<'PY'
190- import tomllib
191- from pathlib import Path
192-
193- manifest = tomllib.loads(Path("spore.toml").read_text(encoding="utf-8"))
194- assert manifest["package"]["type"] == "platform"
195- assert manifest["platform"]["contract-module"] == "platform_contract"
196- assert "Console" in manifest["platform"]["handled-effects"]
197-
198- app_manifest = tomllib.loads(Path("examples/hello-app/spore.toml").read_text(encoding="utf-8"))
199- assert app_manifest["project"]["platform"] == "basic-cli"
200- assert app_manifest["dependencies"]["basic-cli"]["path"] == "../.."
201- PY
202-
203- test -f examples/hello.sp
204- test -f src/platform_contract.sp
205- find src/basic_cli examples -name '*.sp' -type f | sort
0 commit comments