这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
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
55 changes: 35 additions & 20 deletions .github/workflows/checker.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
name: "Checker"
on: # yamllint disable-line rule:truthy
---
name: Checker

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
schedule:
- cron: "0 4 * * 5"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false

permissions:
contents: read

env:
PYTHON_VERSION: "3.13"

jobs:
checker:
name: Checker
runs-on: ubuntu-24.04
search:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note:

  • the Python module name should be searx.checker rather than searx.search.checker.
  • for a time it made sense to embed this tool in the Flask app, I think now it could move to external tool.

name: Search
runs-on: ubuntu-24.04-arm
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"

- 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: '3.13'
architecture: 'x64'
key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
path: "./local"

- name: Install Python dependencies
run: |
make V=1 install
- name: Setup venv
run: make V=1 install

- name: Checker
run: |
make search.checker
- name: Search checker
run: make search.checker
182 changes: 182 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
---
name: Container

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
workflow_run:
workflows:
- Integration
types:
- completed
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false

permissions:
contents: read
# Organization GHCR
packages: read

env:
PYTHON_VERSION: "3.13"

jobs:
build:
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
name: Build (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
os: ubuntu-24.04
emulation: false
- arch: arm64
os: ubuntu-24.04-arm
emulation: false
- arch: armv7
os: ubuntu-24.04-arm
emulation: true

permissions:
# Organization GHCR
packages: write

outputs:
version_string: ${{ steps.build.outputs.version_string }}
version_tag: ${{ steps.build.outputs.version_tag }}
docker_tag: ${{ steps.build.outputs.docker_tag }}
git_url: ${{ steps.build.outputs.git_url }}
git_branch: ${{ steps.build.outputs.git_branch }}

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"

- name: Setup cache Python
uses: actions/cache@v4
with:
key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
path: "./local/"

- name: Setup cache container mounts
uses: actions/cache@v4
with:
key: "container-mounts-${{ matrix.arch }}-${{ hashFiles('./Dockerfile*') }}"
restore-keys: "container-mounts-${{ matrix.arch }}-"
path: |
/var/tmp/buildah-cache/
/var/tmp/buildah-cache-*/

- if: ${{ matrix.emulation }}
name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: "ghcr.io"
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"

- name: Build
id: build
env:
OVERRIDE_ARCH: "${{ matrix.arch }}"
run: make podman.build

test:
name: Test (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
needs: build
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
os: ubuntu-24.04
emulation: false
- arch: arm64
os: ubuntu-24.04-arm
emulation: false
- arch: armv7
os: ubuntu-24.04-arm
emulation: true

permissions:
# Organization GHCR
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: "false"

- if: ${{ matrix.emulation }}
name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: "ghcr.io"
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"

- name: Test
env:
OVERRIDE_ARCH: "${{ matrix.arch }}"
GIT_URL: "${{ needs.build.outputs.git_url }}"
run: make container.test

release:
if: github.repository_owner == 'searxng' && github.ref_name == 'master'
name: Release
runs-on: ubuntu-24.04-arm
needs:
- build
- test

steps:
- if: env.DOCKERHUB_USERNAME != ''
name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: "false"

- if: env.DOCKERHUB_USERNAME != ''
name: Login to GHCR
uses: docker/login-action@v3
with:
registry: "ghcr.io"
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"

- if: env.DOCKERHUB_USERNAME != ''
name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: "docker.io"
username: "${{ env.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"

- if: env.DOCKERHUB_USERNAME != ''
name: Release
env:
GIT_URL: "${{ needs.build.outputs.git_url }}"
DOCKER_TAG: "${{ needs.build.outputs.docker_tag }}"
run: make container.push
82 changes: 47 additions & 35 deletions .github/workflows/data-update.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
name: "Update searx.data"
on: # yamllint disable-line rule:truthy
---
name: Update searx.data

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
schedule:
- cron: "59 23 28 * *"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false

permissions:
contents: read

env:
PYTHON_VERSION: "3.13"

jobs:
updateData:
name: Update data - ${{ matrix.fetch }}
runs-on: ubuntu-24.04
if: ${{ github.repository_owner == 'searxng'}}
data:
if: github.repository_owner == 'searxng'
name: ${{ matrix.fetch }}
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
Expand All @@ -20,48 +33,47 @@ jobs:
- update_engine_traits.py
- update_wikidata_units.py
- update_engine_descriptions.py

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"

- 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: '3.12'
architecture: 'x64'
key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
path: "./local/"

- name: Install Python dependencies
run: |
make V=1 install
- name: Setup venv
run: make V=1 install

- name: Fetch data
env:
FETCH_SCRIPT: ./searxng_extra/update/${{ matrix.fetch }}
run: |
V=1 ./manage pyenv.cmd python "$FETCH_SCRIPT"
run: V=1 ./manage pyenv.cmd python "./searxng_extra/update/${{ matrix.fetch }}"

- name: Create Pull Request
- name: Create PR
id: cpr
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
commit-message: '[data] update searx.data - ${{ matrix.fetch }}'
committer: searxng-bot <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: update_data_${{ matrix.fetch }}
delete-branch: true
draft: false
title: '[data] update searx.data - ${{ matrix.fetch }}'
body: |
update searx.data - ${{ matrix.fetch }}
author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
committer: "searxng-bot <searxng-bot@users.noreply.github.com>"
title: "[data] update searx.data - ${{ matrix.fetch }}"
commit-message: "[data] update searx.data - ${{ matrix.fetch }}"
branch: "update_data_${{ matrix.fetch }}"
delete-branch: "true"
draft: "false"
signoff: "false"
labels: |
data

- name: Check outputs
- name: Display information
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
Loading