Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 15 additions & 56 deletions .github/workflows/l10n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ on:
env:
# * style job configuration
STYLE_FAIL_ON_FAULT: true ## (bool) fail the build if a style job contains a fault (error or warning); may be overridden on a per-job basis

CARGO_INCREMENTAL: "0"
RUST_BACKTRACE: "1"
permissions:
contents: read # to fetch code (actions/checkout)

Expand All @@ -25,8 +26,6 @@ jobs:
l10n_build_test:
name: L10n/Build and Test
runs-on: ${{ matrix.job.os }}
env:
CARGO_INCREMENTAL: 0
strategy:
fail-fast: false
matrix:
Expand All @@ -38,7 +37,6 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
Expand Down Expand Up @@ -75,8 +73,6 @@ jobs:
## Test l10n functionality
cargo test -p uucore locale
cargo test
env:
RUST_BACKTRACE: "1"

l10n_fluent_syntax:
name: L10n/Fluent Syntax Check
Expand All @@ -98,7 +94,7 @@ jobs:
shell: bash
run: |

fluent_dirs=$(find . -name "*.ftl" -type f -exec dirname {} \; | sort | uniq 2>/dev/null || true)
fluent_dirs=$(find . -name "*.ftl" -type f -exec dirname {} \; | sort | uniq 2>/dev/null || :)

if [ -n "$fluent_dirs" ]; then
echo "Found Fluent directories:"
Expand Down Expand Up @@ -133,13 +129,10 @@ jobs:
l10n_clap_error_localization:
name: L10n/Clap Error Localization Test
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
id: sccache-setup
Expand Down Expand Up @@ -206,8 +199,6 @@ jobs:
echo "✗ ERROR: English clap error localization not working properly"
exit 1
fi
env:
RUST_BACKTRACE: "1"

- name: Test French clap error localization
shell: bash
Expand Down Expand Up @@ -271,8 +262,6 @@ jobs:
echo "✗ No ANSI color codes found - colors may not be working"
echo "::warning::ANSI color codes not detected in clap error output"
fi
env:
RUST_BACKTRACE: "1"

- name: Test clap localization with multiple utilities
shell: bash
Expand Down Expand Up @@ -303,19 +292,14 @@ jobs:
echo "✗ ERROR: Clap localization not working for enough utilities"
exit 1
fi
env:
RUST_BACKTRACE: "1"

l10n_french_integration:
name: L10n/French Integration Test
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
id: sccache-setup
Expand Down Expand Up @@ -418,14 +402,10 @@ jobs:
echo "✗ ERROR: No French strings were detected, but commands executed successfully"
exit 1
fi
env:
RUST_BACKTRACE: "1"

l10n_multicall_binary_install:
name: L10n/Multi-call Binary Install Test
runs-on: ${{ matrix.job.os }}
env:
CARGO_INCREMENTAL: 0
strategy:
fail-fast: false
matrix:
Expand All @@ -436,7 +416,6 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
id: sccache-setup
Expand Down Expand Up @@ -477,7 +456,7 @@ jobs:

# First check if binary exists after build
echo "Checking if coreutils was built..."
ls -la target/release-small/coreutils || echo "No coreutils binary in target/release-small/"
target/release-small/coreutils --version || echo "No coreutils binary in target/release-small/"

make FEATURES="${{ matrix.job.features }}" PROFILE=release-small MULTICALL=y

Expand All @@ -486,7 +465,7 @@ jobs:

echo "Running make install..."
echo "Before install - checking what we have:"
ls -la target/release-small/coreutils 2>/dev/null || echo "No coreutils in target/release-small"
target/release-small/coreutils --version 2>/dev/null || echo "No coreutils in target/release-small"

# Run make install with verbose output to see what happens
echo "About to run: make install DESTDIR=\"$INSTALL_DIR\" PREFIX=/usr PROFILE=release-small MULTICALL=y"
Expand All @@ -506,9 +485,8 @@ jobs:
echo "Current directory: $(pwd)"
echo "INSTALL_DIR: $INSTALL_DIR"
echo "Checking if build succeeded..."
if [ -f "target/release-small/coreutils" ]; then
if target/release-small/coreutils --version; then
echo "✓ Build succeeded - coreutils binary exists in target/release-small/"
ls -la target/release-small/coreutils
else
echo "✗ Build failed - no coreutils binary in target/release-small/"
echo "Contents of target/release-small/:"
Expand Down Expand Up @@ -542,7 +520,7 @@ jobs:
find "$INSTALL_DIR" -type f 2>/dev/null | head -50

# As a last resort, check if it's in the build directory
if [ -f "target/release/coreutils" ]; then
if "target/release/coreutils" --version; then
echo "Using binary from build directory as fallback"
COREUTILS_BIN="$(pwd)/target/release/coreutils"
export COREUTILS_BIN
Expand Down Expand Up @@ -581,8 +559,6 @@ jobs:
l10n_installation_test:
name: L10n/Installation Test (Make & Cargo)
runs-on: ${{ matrix.job.os }}
env:
CARGO_INCREMENTAL: 0
strategy:
fail-fast: false
matrix:
Expand All @@ -593,7 +569,6 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
id: sccache-setup
Expand Down Expand Up @@ -635,9 +610,8 @@ jobs:

# Verify installation
echo "Testing make-installed binaries..."
if [ -f "$MAKE_INSTALL_DIR/usr/bin/coreutils" ]; then
if "$MAKE_INSTALL_DIR/usr/bin/coreutils" --version; then
echo "✓ coreutils binary installed via make successfully"
"$MAKE_INSTALL_DIR/usr/bin/coreutils" --version
else
echo "✗ coreutils binary not found after make install"
exit 1
Expand Down Expand Up @@ -736,9 +710,8 @@ jobs:

# Verify installation
echo "Testing cargo-installed binaries..."
if [ -f "$CARGO_INSTALL_DIR/bin/coreutils" ]; then
if "$CARGO_INSTALL_DIR/bin/coreutils" --version; then
echo "✓ coreutils binary installed successfully"
"$CARGO_INSTALL_DIR/bin/coreutils" --version
else
echo "✗ coreutils binary not found after cargo install"
exit 1
Expand Down Expand Up @@ -778,7 +751,7 @@ jobs:
echo "Checking structure of coreutils-l10n-repo:"
ls -la coreutils-l10n-repo/ | head -10
echo "Looking for locales directory:"
find coreutils-l10n-repo -name "*.ftl" -type f 2>/dev/null | head -10 || true
find coreutils-l10n-repo -name "*.ftl" -type f 2>/dev/null | head -10 || :
echo "Checking specific utilities:"
ls -la coreutils-l10n-repo/src/uu/ls/locales/ 2>/dev/null || echo "No ls directory in correct location"
find coreutils-l10n-repo -path "*/ls/*.ftl" 2>/dev/null | head -5 || echo "No ls ftl files found"
Expand Down Expand Up @@ -812,7 +785,7 @@ jobs:

# Debug: Show what was actually installed
echo "Files installed in locale directory:"
find "$LOCALE_DIR" -name "*.ftl" 2>/dev/null | head -10 || true
find "$LOCALE_DIR" -name "*.ftl" 2>/dev/null | head -10 || :

# Fallback: If no files were installed from l10n repo, try copying from main repo
if [ -z "$(find "$LOCALE_DIR" -name "*.ftl" 2>/dev/null)" ]; then
Expand All @@ -822,11 +795,11 @@ jobs:
if [ -d "$util_dir/locales" ]; then
echo "Copying locales for $util_name from main repo..."
mkdir -p "$LOCALE_DIR/$util_name"
cp "$util_dir/locales"/*.ftl "$LOCALE_DIR/$util_name/" 2>/dev/null || true
cp "$util_dir/locales"/*.ftl "$LOCALE_DIR/$util_name/" 2>/dev/null || :
fi
done
echo "Files after fallback:"
find "$LOCALE_DIR" -name "*.ftl" 2>/dev/null | head -10 || true
find "$LOCALE_DIR" -name "*.ftl" 2>/dev/null | head -10 || :
fi

echo "✓ Additional locale files installed"
Expand All @@ -841,7 +814,7 @@ jobs:
LOCALE_DIR="$CARGO_INSTALL_DIR/share/locales"

echo "Checking installed binary..."
if [ ! -f "$CARGO_INSTALL_DIR/bin/coreutils" ]; then
if ! "$CARGO_INSTALL_DIR/bin/coreutils" --version; then
echo "✗ coreutils binary not found"
exit 1
fi
Expand Down Expand Up @@ -926,13 +899,10 @@ jobs:
l10n_locale_support_verification:
name: L10n/Locale Support Verification
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
id: sccache-setup
Expand Down Expand Up @@ -969,7 +939,7 @@ jobs:

# Debug: Show what was installed
echo "Contents of installation directory:"
find "$INSTALL_DIR" -type f -name "coreutils" -o -name "ls" 2>/dev/null | head -20 || true
find "$INSTALL_DIR" -type f -name "coreutils" -o -name "ls" 2>/dev/null | head -20 || :
echo "Looking for binaries in: $INSTALL_DIR/usr/bin/"
ls -la "$INSTALL_DIR/usr/bin/" || echo "Directory not found"

Expand Down Expand Up @@ -1157,19 +1127,14 @@ jobs:
fi

echo "✓ All locale-specific functionality tests passed"
env:
RUST_BACKTRACE: "1"

l10n_embedded_locale_regression_test:
name: L10n/Embedded Locale Regression Test
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
id: sccache-setup
Expand All @@ -1196,7 +1161,6 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
# Use different cache key for each build to avoid conflicts
Expand Down Expand Up @@ -1228,7 +1192,6 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
# Use different cache key for each build to avoid conflicts
Expand Down Expand Up @@ -1260,7 +1223,6 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
# Use different cache key for each build to avoid conflicts
Expand Down Expand Up @@ -1290,13 +1252,10 @@ jobs:
l10n_locale_embedding_cargo_install:
name: L10n/Locale Embedding - Cargo Install
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: cargo-install-locale-embedding
Expand Down
Loading