[mod] refactor integration.yml
Style changes, cleanup and improved integration with CI by leveraging the use of shared cache between all workflows.
This commit is contained in:
		
							parent
							
								
									8e2e7774d7
								
							
						
					
					
						commit
						c360bce6dd
					
				
							
								
								
									
										102
									
								
								.github/workflows/integration.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										102
									
								
								.github/workflows/integration.yml
									
									
									
									
										vendored
									
									
								
							@ -1,58 +1,106 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
name: Integration
 | 
					name: Integration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
on:  # yamllint disable-line rule:truthy
 | 
					# yamllint disable-line rule:truthy
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
  push:
 | 
					  push:
 | 
				
			||||||
    branches: ["master"]
 | 
					    branches:
 | 
				
			||||||
 | 
					      - master
 | 
				
			||||||
  pull_request:
 | 
					  pull_request:
 | 
				
			||||||
    branches: ["master"]
 | 
					    branches:
 | 
				
			||||||
 | 
					      - master
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					concurrency:
 | 
				
			||||||
 | 
					  group: ${{ github.workflow }}-${{ github.ref_name }}
 | 
				
			||||||
 | 
					  cancel-in-progress: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
permissions:
 | 
					permissions:
 | 
				
			||||||
  contents: read
 | 
					  contents: read
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					env:
 | 
				
			||||||
 | 
					  PYTHON_VERSION: "3.13"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
  python:
 | 
					  test:
 | 
				
			||||||
    name: Python ${{ matrix.python-version }}
 | 
					    name: Python ${{ matrix.python-version }}
 | 
				
			||||||
    runs-on: ubuntu-24.04
 | 
					    runs-on: ubuntu-24.04
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        os: [ubuntu-24.04]
 | 
					        python-version:
 | 
				
			||||||
        python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
 | 
					          - "3.9"
 | 
				
			||||||
 | 
					          - "3.10"
 | 
				
			||||||
 | 
					          - "3.11"
 | 
				
			||||||
 | 
					          - "3.12"
 | 
				
			||||||
 | 
					          - "3.13"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Setup Python
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					 | 
				
			||||||
      - name: Install Ubuntu packages
 | 
					 | 
				
			||||||
        run: |
 | 
					 | 
				
			||||||
          sudo ./utils/searxng.sh install packages
 | 
					 | 
				
			||||||
      - name: Set up Python
 | 
					 | 
				
			||||||
        uses: actions/setup-python@v5
 | 
					        uses: actions/setup-python@v5
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          python-version: ${{ matrix.python-version }}
 | 
					          python-version: "${{ matrix.python-version }}"
 | 
				
			||||||
          architecture: 'x64'
 | 
					
 | 
				
			||||||
 | 
					      - name: Checkout
 | 
				
			||||||
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          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
 | 
					      - name: Run tests
 | 
				
			||||||
        run: make V=1 ci.test
 | 
					        run: make V=1 ci.test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  themes:
 | 
					  theme:
 | 
				
			||||||
    name: Themes
 | 
					    name: Theme
 | 
				
			||||||
    runs-on: ubuntu-24.04
 | 
					    runs-on: ubuntu-24.04-arm
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Setup Python
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					 | 
				
			||||||
      - name: Install Ubuntu packages
 | 
					 | 
				
			||||||
        run: sudo ./utils/searxng.sh install buildhost
 | 
					 | 
				
			||||||
      - name: Set up Python
 | 
					 | 
				
			||||||
        uses: actions/setup-python@v5
 | 
					        uses: actions/setup-python@v5
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          python-version: '3.12'
 | 
					          python-version: "${{ env.PYTHON_VERSION }}"
 | 
				
			||||||
          architecture: 'x64'
 | 
					
 | 
				
			||||||
      - name: Build themes
 | 
					      - name: Checkout
 | 
				
			||||||
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          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
 | 
					        run: make themes.all
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  dockers:
 | 
					  dockers:
 | 
				
			||||||
    name: Docker
 | 
					    name: Docker
 | 
				
			||||||
    if: github.ref == 'refs/heads/master'
 | 
					    if: github.ref == 'refs/heads/master'
 | 
				
			||||||
    needs:
 | 
					    needs:
 | 
				
			||||||
      - python
 | 
					      - test
 | 
				
			||||||
      - themes
 | 
					      - theme
 | 
				
			||||||
    env:
 | 
					    env:
 | 
				
			||||||
      DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
 | 
					      DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
 | 
				
			||||||
    runs-on: ubuntu-24.04
 | 
					    runs-on: ubuntu-24.04
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user