fix: workflow fixes
Some checks failed
/ check-changes (push) Successful in 1m1s
/ build (push) Failing after 1m27s

This commit is contained in:
Djuri 2025-05-03 18:48:32 +02:00
parent 5917713b0d
commit fbe0781229
Signed by: djuri
GPG key ID: 61B9B2DDE5AA3AC1
2 changed files with 32 additions and 4 deletions

View file

@ -41,15 +41,15 @@ jobs:
with: with:
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
node-version: lts/* node-version: lts/*
cache: yarn cache: pnpm
cache-dependency-path: '**/yarn.lock' cache-dependency-path: '**/pnpm-lock.yaml'
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
path: | path: |
~/.cache/pip ~/.cache/pip
~/node_modules ~/node_modules
~/.cache/ms-playwright ~/.cache/ms-playwright
key: ${{ runner.os }}-pio-playwright-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-pio-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Get current date - name: Get current date
id: dateAndTime id: dateAndTime
run: echo "dateAndTime=$(date +'%Y-%m-%d-%H:%M')" >> $GITHUB_OUTPUT run: echo "dateAndTime=$(date +'%Y-%m-%d-%H:%M')" >> $GITHUB_OUTPUT
@ -71,7 +71,7 @@ jobs:
- name: Run Playwright tests - name: Run Playwright tests
run: npx playwright test run: npx playwright test
- name: Build WebUI - name: Build WebUI
run: yarn build run: pnpm build
# The following steps only run on push to main # The following steps only run on push to main
- name: Get current block - name: Get current block

28
gzip_build.py Normal file
View file

@ -0,0 +1,28 @@
import os
import gzip
from shutil import copyfileobj
from pathlib import Path
def gzip_file(input_file, output_file):
with open(input_file, 'rb') as f_in:
with gzip.open(output_file, 'wb') as f_out:
copyfileobj(f_in, f_out)
def process_directory(input_dir, output_dir):
for root, dirs, files in os.walk(input_dir):
relative_path = os.path.relpath(root, input_dir)
output_root = os.path.join(output_dir, relative_path)
Path(output_root).mkdir(parents=True, exist_ok=True)
for file in files:
# if file.endswith(('.html', '.css', '.js')):
input_file_path = os.path.join(root, file)
output_file_path = os.path.join(output_root, file + '.gz')
gzip_file(input_file_path, output_file_path)
print(f'Compressed: {input_file_path} -> {output_file_path}')
input_directory = 'dist'
output_directory = 'build_gz'
process_directory(input_directory, output_directory)