refactor integration.yml

This commit is contained in:
Ivan Gabaldon 2025-05-04 22:04:14 +02:00
parent a7efdd908b
commit 8f5296e8c7
No known key found for this signature in database
GPG Key ID: 075587C93FA67582
4 changed files with 75 additions and 69 deletions

View File

@ -8,9 +8,9 @@ on:
- Integration
types:
- completed
# TODO: Uncomment
# branches:
# - master
# TODO: Test container.yml on merge https://github.com/searxng/searxng/pull/4699
branches:
- master
permissions:
contents: read
@ -55,7 +55,7 @@ jobs:
with:
key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
path: "./local"
path: "./local/"
- name: Setup cache container mounts
uses: actions/cache@v4

View File

@ -46,7 +46,7 @@ jobs:
with:
key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
path: "./local"
path: "./local/"
- name: Setup venv
run: make V=1 install

View File

@ -1,3 +1,4 @@
---
name: Integration
# yamllint disable-line rule:truthy
@ -13,8 +14,11 @@ on:
permissions:
contents: read
env:
PYTHON_VERSION: "3.13"
jobs:
python:
test:
# TODO: Remove this
if: false
name: Python ${{ matrix.python-version }}
@ -29,139 +33,140 @@ jobs:
- "3.13"
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: "false"
- name: Install Ubuntu packages
run: sudo ./utils/searxng.sh install packages
- name: Set up Python
uses: actions/setup-python@v5
- name: Setup cache Python
uses: actions/cache@v4
with:
python-version: "${{ matrix.python-version }}"
key: "python-${{ matrix.python-version }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
restore-keys: "python-${{ matrix.python-version }}-${{ runner.arch }}-"
path: "./local/"
- name: Setup venv
run: make V=1 install
- name: Run tests
run: make V=1 ci.test
themes:
theme:
# TODO: Remove this
if: false
name: Themes
runs-on: ubuntu-24.04
name: Theme
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: "false"
- name: Install Ubuntu packages
run: sudo ./utils/searxng.sh install buildhost
- name: Set up Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
with:
python-version: "3.13"
node-version-file: "./.nvmrc"
- name: Build themes
- name: Setup cache Node.js
uses: actions/cache@v4
with:
key: "nodejs-${{ runner.arch }}-${{ hashFiles('./.nvmrc', './package.json') }}"
path: "./client/simple/node_modules/"
- name: Build
run: make themes.all
documentation:
# TODO: Remove this
if: false
name: Documentation
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
permissions:
# for JamesIves/github-pages-deploy-action to push
contents: write
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: "false"
fetch-depth: "0"
- name: Install Ubuntu packages
run: sudo ./utils/searxng.sh install buildhost
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Cache Python dependencies
id: cache-python
- name: Setup cache Python
uses: actions/cache@v4
with:
path: |
./local
./.nvm
./node_modules
key: python-ubuntu-24.04-3.13-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
path: "./local/"
- name: Setup venv
run: make V=1 install
- name: Build documentation
run: make V=1 docs.clean docs.html
- if: github.ref == 'refs/heads/master'
name: Deploy
uses: JamesIves/github-pages-deploy-action@3.7.1
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: "${{ github.token }}"
BRANCH: "gh-pages"
FOLDER: "dist/docs"
folder: "dist/docs"
branch: "gh-pages"
commit-message: "[doc] build from commit ${{ github.sha }}"
# Automatically remove deleted files from the deploy branch
CLEAN: "true"
SINGLE_COMMIT: "true"
COMMIT_MESSAGE: "[doc] build from commit ${{ github.sha }}"
clean: "true"
single-commit: "true"
babel:
# TODO: Remove this
if: false
# if: github.repository_owner == 'searxng' && github.ref == 'refs/heads/master'
if: github.repository_owner == 'searxng' && github.ref == 'refs/heads/master'
name: Update translations branch
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm
needs:
- python
- themes
- test
- theme
- documentation
permissions:
# for make V=1 weblate.push.translations
# For "make V=1 weblate.push.translations"
contents: write
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Checkout
uses: actions/checkout@v4
with:
token: "${{ secrets.WEBLATE_GITHUB_TOKEN }}"
fetch-depth: "0"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Cache Python dependencies
id: cache-python
- name: Setup cache Python
uses: actions/cache@v4
with:
path: |
./local
./.nvm
./node_modules
key: python-ubuntu-20.04-3.13-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
path: "./local/"
- name: Setup venv
run: make V=1 install
- name: weblate & git setup
env:
WEBLATE_CONFIG: "${{ secrets.WEBLATE_CONFIG }}"
run: |
mkdir -p ~/.config
echo "${WEBLATE_CONFIG}" > ~/.config/weblate
echo "${{ secrets.WEBLATE_CONFIG }}" > ~/.config/weblate
git config --global user.email "searxng-bot@users.noreply.github.com"
git config --global user.name "searxng-bot"
- name: Update transations
id: update
run: make V=1 weblate.push.translations

View File

@ -100,5 +100,6 @@ $(MANAGE):
PHONY += docs docker themes
docs: docs.html
docker: docker.build
container: container.build
docker: container.build
themes: themes.all