diff options
| author | Ivan Gabaldon <igabaldon@inetol.net> | 2025-05-10 13:59:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-10 13:59:31 +0200 |
| commit | 1b787ed35e9c51e335c42faee1f76695780ba4cb (patch) | |
| tree | a552c6534b1b900281ec5ba3192a025ac556f304 /.github/workflows | |
| parent | 8e2e7774d7aeb13eac29c4dc16d65a2051ca250d (diff) | |
[mod] refactor integration.yml (#4763)
Style changes, cleanup and improved integration with CI by leveraging the use of
shared cache between all workflows.
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/integration.yml | 98 |
1 files changed, 73 insertions, 25 deletions
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index eb4f458d7..abdaf0c18 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,58 +1,106 @@ +--- name: Integration -on: # yamllint disable-line rule:truthy +# yamllint disable-line rule:truthy +on: push: - branches: ["master"] + branches: + - master pull_request: - branches: ["master"] + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: false permissions: contents: read +env: + PYTHON_VERSION: "3.13" + jobs: - python: + test: name: Python ${{ matrix.python-version }} runs-on: ubuntu-24.04 strategy: matrix: - os: [ubuntu-24.04] - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "3.13" + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "${{ matrix.python-version }}" + - name: Checkout uses: actions/checkout@v4 - - name: Install Ubuntu packages - run: | - sudo ./utils/searxng.sh install packages - - name: Set up Python - uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} - architecture: 'x64' + persist-credentials: "false" + + - name: Setup cache Python + uses: actions/cache@v4 + with: + 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: - name: Themes - runs-on: ubuntu-24.04 + theme: + name: Theme + 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 - - name: Install Ubuntu packages - run: sudo ./utils/searxng.sh install buildhost - - name: Set up Python - uses: actions/setup-python@v5 with: - python-version: '3.12' - architecture: 'x64' - - name: Build themes + persist-credentials: "false" + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: "./.nvmrc" + + - name: Setup cache Node.js + uses: actions/cache@v4 + with: + key: "nodejs-${{ runner.arch }}-${{ hashFiles('./.nvmrc', './package.json') }}" + path: "./client/simple/node_modules/" + + - 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 venv + run: make V=1 install + + - name: Build run: make themes.all dockers: name: Docker if: github.ref == 'refs/heads/master' needs: - - python - - themes + - test + - theme env: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} runs-on: ubuntu-24.04 |