Skip to content

Commit 523fac8

Browse files
chore(ci): install Roboto font from Google Fonts instead of apt (DevExpress#33317)
1 parent 8cfe9a6 commit 523fac8

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

.github/workflows/demos_visual_tests.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -546,23 +546,38 @@ jobs:
546546
- name: Install dependencies
547547
run: pnpm install --frozen-lockfile
548548

549+
- name: Set Roboto font directory
550+
if: contains(matrix.THEME, 'material')
551+
run: echo "ROBOTO_FONT_DIR=${HOME}/.local/share/fonts/roboto" >> $GITHUB_ENV
552+
549553
- name: Cache Roboto font
550554
if: contains(matrix.THEME, 'material')
551555
id: cache-roboto
552556
uses: actions/cache@v4
553557
with:
554-
path: /usr/share/fonts/truetype/roboto
555-
key: roboto-font-${{ runner.os }}
558+
path: ${{ env.ROBOTO_FONT_DIR }}
559+
key: roboto-font-${{ runner.os }}-8b0a1d0f5983c89bc2b93f1b5fb55f9e252744b5
556560

557561
- name: Install Roboto font for Material theme
558562
if: contains(matrix.THEME, 'material') && steps.cache-roboto.outputs.cache-hit != 'true'
563+
env:
564+
GOOGLE_FONTS_COMMIT: 8b0a1d0f5983c89bc2b93f1b5fb55f9e252744b5
565+
ROBOTO_SHA256: d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134
559566
run: |
560-
echo "Installing Roboto font..."
561-
sudo apt-get update -qq
562-
sudo apt-get install -y -qq fonts-roboto fonts-roboto-unhinted
563-
sudo fc-cache -f -v > /dev/null 2>&1 || true
567+
echo "Installing Roboto font from google/fonts (pinned commit)..."
568+
mkdir -p "$ROBOTO_FONT_DIR"
569+
BASE_URL="https://raw.githubusercontent.com/google/fonts/${GOOGLE_FONTS_COMMIT}/ofl/roboto"
570+
571+
curl -fsSL "${BASE_URL}/Roboto%5Bwdth%2Cwght%5D.ttf" -o /tmp/Roboto.ttf
572+
echo "${ROBOTO_SHA256} /tmp/Roboto.ttf" | sha256sum -c -
573+
574+
mv /tmp/Roboto.ttf "$ROBOTO_FONT_DIR/"
564575
echo "Roboto font installed"
565576
577+
- name: Refresh font cache
578+
if: contains(matrix.THEME, 'material')
579+
run: fc-cache -f > /dev/null 2>&1
580+
566581
- name: Run Web Server
567582
run: python -m http.server 8080 &
568583

-8.73 KB
Loading

0 commit comments

Comments
 (0)