|
|
@@ -1,6 +1,9 @@ |
|
|
#!/bin/bash |
|
|
#!/bin/bash |
|
|
set -euo |
|
|
set -euo |
|
|
|
|
|
|
|
|
|
|
|
# Check if we are running in a GitHub Actions environment |
|
|
|
|
|
CI=${GITHUB_ACTIONS:-false} |
|
|
|
|
|
|
|
|
# List of ignored modules |
|
|
# List of ignored modules |
|
|
ignored_folders=("dora-parler" "dora-opus" "dora-internvl" "dora-magma") |
|
|
ignored_folders=("dora-parler" "dora-opus" "dora-internvl" "dora-magma") |
|
|
|
|
|
|
|
|
@@ -13,6 +16,31 @@ dir=$(pwd) |
|
|
# Get the base name of the directory (without the path) |
|
|
# Get the base name of the directory (without the path) |
|
|
base_dir=$(basename "$dir") |
|
|
base_dir=$(basename "$dir") |
|
|
|
|
|
|
|
|
|
|
|
# Large node list requiring space cleanup |
|
|
|
|
|
large_node=("dora-phi4") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check if the current directory is in the large node list and if we're in the CI environment |
|
|
|
|
|
if [[ " ${large_node[@]} " =~ " ${base_dir} " ]] && [[ "$CI" == "true" ]]; then |
|
|
|
|
|
echo "Running cleanup for $base_dir..." |
|
|
|
|
|
sudo rm -rf /opt/hostedtoolcache/CodeQL || : |
|
|
|
|
|
# 1.4GB |
|
|
|
|
|
sudo rm -rf /opt/hostedtoolcache/go || : |
|
|
|
|
|
# 489MB |
|
|
|
|
|
sudo rm -rf /opt/hostedtoolcache/PyPy || : |
|
|
|
|
|
# 376MB |
|
|
|
|
|
sudo rm -rf /opt/hostedtoolcache/node || : |
|
|
|
|
|
# Remove Web browser packages |
|
|
|
|
|
sudo apt purge -y \ |
|
|
|
|
|
firefox \ |
|
|
|
|
|
google-chrome-stable \ |
|
|
|
|
|
microsoft-edge-stable |
|
|
|
|
|
sudo rm -rf /usr/local/lib/android/ |
|
|
|
|
|
sudo rm -rf /usr/share/dotnet/ |
|
|
|
|
|
sudo rm -rf /opt/ghc/ |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check if the directory name is in the ignored list |
|
|
# Check if the directory name is in the ignored list |
|
|
if [[ " ${ignored_folders[@]} " =~ " ${base_dir} " ]]; then |
|
|
if [[ " ${ignored_folders[@]} " =~ " ${base_dir} " ]]; then |
|
|
echo "Skipping $base_dir as we cannot test it on the CI..." |
|
|
echo "Skipping $base_dir as we cannot test it on the CI..." |
|
|
@@ -69,7 +97,7 @@ else |
|
|
maturin publish --target x86_64-apple-darwin --skip-existing --zig |
|
|
maturin publish --target x86_64-apple-darwin --skip-existing --zig |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
elif [[ "$(uname)" = "Linux" ]]; then |
|
|
|
|
|
|
|
|
elif [[ "$(uname)" = "Linux" ]] || [[ "$CI" == "false" ]]; then |
|
|
if [ -f "$dir/Cargo.toml" ]; then |
|
|
if [ -f "$dir/Cargo.toml" ]; then |
|
|
echo "Running build and tests for Rust project in $dir..." |
|
|
echo "Running build and tests for Rust project in $dir..." |
|
|
cargo check |
|
|
cargo check |
|
|
@@ -92,9 +120,9 @@ else |
|
|
if [[ " ${skip_test_folders[@]} " =~ " ${base_dir} " ]]; then |
|
|
if [[ " ${skip_test_folders[@]} " =~ " ${base_dir} " ]]; then |
|
|
echo "Skipping tests for $base_dir..." |
|
|
echo "Skipping tests for $base_dir..." |
|
|
else |
|
|
else |
|
|
uv run pytest |
|
|
|
|
|
|
|
|
uv run pytest -x |
|
|
fi |
|
|
fi |
|
|
if [ "$GITHUB_EVENT_NAME" == "release" ] || [ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]; then |
|
|
|
|
|
|
|
|
if [ "${GITHUB_EVENT_NAME:-false}" == "release" ] || [ "${GITHUB_EVENT_NAME:-false}" == "workflow_dispatch" ]; then |
|
|
uv build |
|
|
uv build |
|
|
uv publish --check-url https://pypi.org/simple |
|
|
uv publish --check-url https://pypi.org/simple |
|
|
fi |
|
|
fi |
|
|
|