Skip to content

chore: update user stats endpoints to reflect new API guidelines #783

chore: update user stats endpoints to reflect new API guidelines

chore: update user stats endpoints to reflect new API guidelines #783

Workflow file for this run

name: CI check
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
types: [checks_requested]
workflow_dispatch:
defaults:
run:
shell: bash
permissions:
contents: read
packages: read
jobs:
changes:
runs-on: ubuntu-24.04
if: ${{ !github.event.pull_request.draft }}
outputs:
python: ${{ steps.filter.outputs.python }}
go: ${{ steps.filter.outputs.go }}
docs: ${{ steps.filter.outputs.docs }}
lint: ${{ steps.filter.outputs.lint }}
image: ${{ steps.image.outputs.tag }}
steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
- name: Set build env image tag
id: image
run: |
ref="${{ github.event.merge_group.base_ref || github.base_ref || github.ref_name }}"
echo "tag=${ref#refs/heads/}" >> $GITHUB_OUTPUT
- uses: dorny/paths-filter@61f87a10cd2c304679af17bb73ef192addf33c1c
id: filter
with:
filters: |
lint:
- 'src/**/*.py'
- 'pyproject.toml'
- 'tox.ini'
- 'setup.py'
- 'openapi.yaml'
- 'Makefile'
- 'utilities/**'
- 'src/**/*.go'
- 'src/**/go.mod'
- 'src/**/go.sum'
- 'src/**/Makefile'
- 'snap/local/tree/usr/bin/*'
python:
- 'src/**/*.py'
- 'utilities/generate_builders.py'
- 'utilities/run-py-tests-ci'
- 'pyproject.toml'
- 'tox.ini'
go:
- 'src/**/*.go'
- 'src/**/go.mod'
- 'src/**/go.sum'
docs:
- 'docs/**'
- 'src/**/*.py'
- 'utilities/run-py-tests-ci'
- 'pyproject.toml'
- 'tox.ini'
- 'required-packages/base'
- 'snap/snapcraft.yaml'
lint:
runs-on: ubuntu-24.04
needs: changes
if: >-
${{ !github.event.pull_request.draft && needs.changes.outputs.lint == 'true' }}
container:
image: ghcr.io/${{ github.repository }}-build-env:${{ needs.changes.outputs.image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
- uses: ./.github/actions/ci-setup
- name: Run lint
run: |
su ubuntu -c "make lint"
test-python:
needs: changes
runs-on: ubuntu-24.04
if: >-
${{ !github.event.pull_request.draft && needs.changes.outputs.python == 'true' }}
container:
image: ghcr.io/${{ github.repository }}-build-env:${{ needs.changes.outputs.image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
- uses: ./.github/actions/ci-setup
- name: Test
run: |
CACHE_DIR=/home/ubuntu/.cache/pip
su ubuntu -c "PIP_CACHE_DIR=$CACHE_DIR make test-py"
test-go:
needs: changes
runs-on: ubuntu-24.04
if: >-
${{ !github.event.pull_request.draft && needs.changes.outputs.go == 'true' }}
container:
image: ghcr.io/${{ github.repository }}-build-env:${{ needs.changes.outputs.image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
- uses: ./.github/actions/ci-setup
- name: Test
run: |
su ubuntu -c "make test-go"
test-docs:
needs: changes
runs-on: ubuntu-24.04
if: >-
${{ !github.event.pull_request.draft && needs.changes.outputs.docs == 'true' }}
steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
fetch-depth: 0
- name: Create venv
working-directory: "docs"
run: make install
- name: Lint markdown
working-directory: "docs"
run: make lint-md
- name: Test build
working-directory: "docs"
run: make html
- name: Run scripts tests
working-directory: "docs"
run: |
source .sphinx/venv/bin/activate
pip install -r requirements-dev.txt
cd _scripts && python -m pytest .
ci-check:
runs-on: ubuntu-slim
if: always()
needs: [lint, test-python, test-go, test-docs]
steps:
- name: Check job results
if: contains(needs.*.result, 'failure')
run: exit 1