Bump the minor-patch group with 4 updates (#3711) #2371
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
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| name: Unit Testing | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint and check format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Actions Lint | |
| uses: raven-actions/actionlint@v2 | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: make lint | |
| run: make lint | |
| - name: Run ShellCheck | |
| uses: ludeeus/action-shellcheck@master | |
| with: | |
| scandir: './scripts' | |
| unit-test: | |
| name: Unit Tests | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| pyenv: [py310, py311, py312, py312-raw] | |
| include: | |
| - pyenv: py310 | |
| python-version: "3.10" | |
| - pyenv: py311 | |
| python-version: "3.11" | |
| - pyenv: py312 | |
| python-version: "3.12" | |
| - pyenv: py312-raw | |
| python-version: "3.12" | |
| services: | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| memcached: | |
| image: memcached | |
| options: >- | |
| --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/udp/127.0.0.1/11211'" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 11211:11211 | |
| redis: | |
| image: redis | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true | |
| - name: Create database | |
| env: | |
| PGPASSWORD: postgres | |
| run: | | |
| psql -c "CREATE DATABASE testdb ENCODING 'UTF8' TEMPLATE template0;" -U postgres -h localhost | |
| - name: Run tests with minimal dependencies | |
| if: endsWith(matrix.pyenv, '-raw') == true | |
| run: make tests-raw | |
| - name: Run tests with optional dependencies | |
| if: endsWith(matrix.pyenv, '-raw') != true | |
| env: | |
| COVERAGE_DEBUG: config,trace,pathmap | |
| run: make tests | |
| - name: Coveralls for ${{ matrix.pyenv }} | |
| if: endsWith(matrix.pyenv, '-raw') != true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERALLS_FLAG_NAME: ${{ matrix.pyenv }} | |
| COVERALLS_PARALLEL: true | |
| run: | | |
| uv pip install tomli coveralls | |
| .venv/bin/coveralls --service=github || true | |
| finish: | |
| name: Coveralls Finished | |
| needs: unit-test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Coveralls Finished | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: uvx --with tomli coveralls --service=github --finish || true | |
| functional: | |
| name: Functional | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| env: | |
| DOCKER_CACHE: /tmp/docker-cache | |
| TEST_TAG: user/app:test | |
| services: | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: | | |
| make install-dev | |
| - name: Create database | |
| env: | |
| PGPASSWORD: postgres | |
| run: | | |
| psql -c "CREATE DATABASE testdb ENCODING 'UTF8' TEMPLATE template0;" -U postgres -h localhost | |
| - run: mkdir "${DOCKER_CACHE}" | |
| - name: Compute cache key | |
| # Create hash of hashes of checked in files not in Dockerignore | |
| run: echo "CACHE_KEY=$(git ls-tree --full-tree -r HEAD | grep -v -f .dockerignore | awk '{print $3}' | git hash-object --stdin)" >> "$GITHUB_ENV" | |
| - uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.DOCKER_CACHE}} | |
| key: docker-build-${{ hashFiles('Dockerfile') }}-${{ env.CACHE_KEY }} | |
| restore-keys: | | |
| docker-build-${{ hashFiles('Dockerfile') }}-${{ env.CACHE_KEY }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build container | |
| uses: docker/build-push-action@v7 | |
| with: | |
| cache-from: type=local,src=${{ env.DOCKER_CACHE}} | |
| cache-to: type=local,dest=${{ env.DOCKER_CACHE}},mode=max | |
| tags: ${{ env.TEST_TAG }} | |
| file: Dockerfile | |
| load: true | |
| context: . | |
| - name: Run container | |
| env: | |
| PROMETHEUS_MULTIPROC_DIR: /tmp/metrics | |
| run: | | |
| docker run --net=host --detach --rm \ | |
| -p 8888:8888 \ | |
| -v "$(pwd)"/tests/functional.ini:/etc/functional.ini \ | |
| -e KINTO_INI=/etc/functional.ini \ | |
| "${{ env.TEST_TAG }}" && sleep 5 | |
| - name: Functional Tests | |
| run: | | |
| make functional || sleep 5 && make functional | |
| - name: Show logs on failure | |
| if: failure() | |
| run: docker logs "$(docker ps -q --filter ancestor=${{ env.TEST_TAG }})" | |
| kinto-admin: | |
| name: Kinto Admin | |
| needs: [lint, functional] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "18.x" | |
| - name: geckodriver/firefox | |
| run: | | |
| echo "geckodriver/firefox" | |
| which geckodriver | |
| geckodriver --version | |
| which firefox | |
| firefox --version | |
| - name: make pull-kinto-admin | |
| run: make pull-kinto-admin | |
| - name: Install dependencies | |
| run: make install-dev | |
| - name: Start Kinto | |
| run: .venv/bin/kinto start --ini tests/browser.ini & sleep 5 | |
| - name: Browser Tests | |
| run: make browser-test | |
| docs: | |
| name: Validate docs | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: make docs | |
| run: make docs | |
| - name: Package description | |
| run: make test-description |