-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[mod] rework container CI/CD #4707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9b8517a
Initial update
inetol bbbd61e
refactor checker.yml
inetol a7efdd9
refactor data-update.yml
inetol 8f5296e
refactor integration.yml
inetol 0969926
refactor security.yml
inetol ee28f8e
compat Dockerfile & misc fixes
inetol b1ffeb0
add test job
inetol e37bd44
run workflows sequentially by default
inetol a311c4a
fix getting branch on fork branches
inetol be04143
migrate image release process
inetol 4314b0e
cleanup
inetol af5a3db
copilot review changes
inetol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | ||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note:
searx.checkerrather thansearx.search.checker.