ci: use elastic registry only if available #526
Workflow file for this run
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
| name: ci | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/env-install | |
| - uses: pre-commit/[email protected] | |
| license-header-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: ./scripts/license_headers_check.sh | |
| pip-installable: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/env-install | |
| - run: pip install -e . | |
| pip-licenses: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/env-install | |
| - run: pip install -e . | |
| - run: pip install pip-licenses | |
| - run: pip-licenses | |
| operator-image-buildable: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/env-install | |
| - run: pip install build | |
| - run: python -m build | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | |
| - run: docker build -f operator/Dockerfile --build-arg PYTHON_GLIBC_IMAGE=cgr.dev/chainguard/python --build-arg PYTHON_GLIBC_IMAGE_VERSION=latest --build-arg DISTRO_DIR=./dist --build-arg IMAGE=cgr.dev/chainguard/busybox --build-arg IMAGE_VERSION=latest . | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| py38: 3.8 | |
| py39: 3.9 | |
| py310: "3.10" | |
| py311: "3.11" | |
| py312: "3.12" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [py38, py39, py310, py311, py312] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ env[matrix.python-version] }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env[matrix.python-version] }} | |
| architecture: "x64" | |
| - run: pip install -r dev-requirements.txt | |
| - run: pytest --with-integration-tests |