-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
73 changed files
with
1,469 additions
and
1,563 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
name: 'Cache' | ||
description: "This action caches fixtures" | ||
name: Cache | ||
|
||
description: This action caches fixtures | ||
|
||
outputs: | ||
cache-hit: | ||
description: 'Cache hit' | ||
value: ${{ steps.cache_output.outputs.cache-hit }} | ||
description: Cache hit | ||
value: ${{ steps.cache.outputs.cache-hit }} | ||
|
||
runs: | ||
using: "composite" | ||
using: composite | ||
steps: | ||
- uses: actions/cache@v4 | ||
id: cache_fixtures | ||
id: cache | ||
with: | ||
path: | | ||
test/fixtures/grammars | ||
target/release/tree-sitter-*.wasm | ||
key: fixtures-${{ join(matrix.*, '_') }}-${{ hashFiles( | ||
'cli/src/generate/**', | ||
'script/generate-fixtures*', | ||
'cli/generate/src/**', | ||
'xtask/src/*', | ||
'test/fixtures/grammars/*/**/src/*.c', | ||
'.github/actions/cache/action.yml') }} | ||
|
||
- run: echo "cache-hit=${{ steps.cache_fixtures.outputs.cache-hit }}" >> $GITHUB_OUTPUT | ||
shell: bash | ||
id: cache_output |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,3 @@ | ||
#!/bin/bash | ||
#!/bin/bash -eu | ||
|
||
# set -x | ||
set -e | ||
|
||
if [ "$BUILD_CMD" != "cross" ]; then | ||
echo "cross.sh - is a helper to assist only in cross compiling environments" >&2 | ||
echo "To use this tool set the BUILD_CMD env var to the \"cross\" value" >&2 | ||
exit 111 | ||
fi | ||
|
||
if [ -z "$CROSS_IMAGE" ]; then | ||
echo "The CROSS_IMAGE env var should be provided" >&2 | ||
exit 111 | ||
fi | ||
|
||
docker run --rm -v /home/runner:/home/runner -w "$PWD" "$CROSS_IMAGE" "$@" | ||
exec docker run --rm -v /home/runner:/home/runner -w "$PWD" "$CROSS_IMAGE" "$@" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,9 @@ | ||
#!/bin/bash | ||
#!/bin/bash -eu | ||
|
||
# set -x | ||
set -e | ||
tree_sitter="$ROOT"/target/"$TARGET"/release/tree-sitter | ||
|
||
if [ "$BUILD_CMD" == "cross" ]; then | ||
if [ -z "$CC" ]; then | ||
echo "make.sh: CC is not set" >&2 | ||
exit 111 | ||
fi | ||
if [ -z "$AR" ]; then | ||
echo "make.sh: AR is not set" >&2 | ||
exit 111 | ||
fi | ||
|
||
cross.sh make CC=$CC AR=$AR "$@" | ||
if [[ $BUILD_CMD == cross ]]; then | ||
cross.sh make CC="$CC" AR="$AR" "$@" | ||
else | ||
make "$@" | ||
exec make "$@" | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# set -x | ||
set -e | ||
|
||
if [ -z "$ROOT" ]; then | ||
echo "The ROOT env var should be set to absolute path of a repo root folder" >&2 | ||
exit 111 | ||
fi | ||
|
||
if [ -z "$TARGET" ]; then | ||
echo "The TARGET env var should be equal to a \`cargo build --target <TARGET>\` command value" >&2 | ||
exit 111 | ||
fi | ||
#!/bin/bash -eu | ||
|
||
tree_sitter="$ROOT"/target/"$TARGET"/release/tree-sitter | ||
|
||
if [ "$BUILD_CMD" == "cross" ]; then | ||
if [ -z "$CROSS_RUNNER" ]; then | ||
echo "The CROSS_RUNNER env var should be set to a CARGO_TARGET_*_RUNNER env var value" >&2 | ||
echo "that is available in a docker image used by the cross tool under the hood" >&2 | ||
exit 111 | ||
fi | ||
|
||
cross.sh $CROSS_RUNNER "$tree_sitter" "$@" | ||
if [[ $BUILD_CMD == cross ]]; then | ||
cross.sh "$CROSS_RUNNER" "$tree_sitter" "$@" | ||
else | ||
"$tree_sitter" "$@" | ||
exec "$tree_sitter" "$@" | ||
fi |
This file contains 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
Oops, something went wrong.