Skip to content

update CHANGELOG and bump version to 6.22.2 (#2048) #1374

update CHANGELOG and bump version to 6.22.2 (#2048)

update CHANGELOG and bump version to 6.22.2 (#2048) #1374

Workflow file for this run

name: test # The name must be the same as in test-docs.yml
on:
workflow_call:
inputs:
full-matrix:
description: "Run the full matrix"
required: true
type: boolean
ref:
description: "The git ref of elastic/apm-agent-python to run test workflow from."
required: false
type: string
pull_request:
paths-ignore:
- "**/*.md"
- "**/*.asciidoc"
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "**/*.asciidoc"
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
inputs:
full-matrix:
description: "Run the full matrix"
required: true
type: boolean
permissions:
contents: read
jobs:
build-distribution:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-distribution
create-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
data: ${{ steps.split.outputs.data }}
chunks: ${{ steps.split.outputs.chunks }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- id: generate
uses: elastic/apm-pipeline-library/.github/actions/version-framework@current
with:
# Use .ci/.matrix_python_full.yml if it's a scheduled workflow, otherwise use .ci/.matrix_python.yml
versionsFile: .ci/.matrix_python${{ (github.event_name == 'schedule' || github.event_name == 'push' || inputs.full-matrix) && '_full' || '' }}.yml
# Use .ci/.matrix_framework_full.yml if it's a scheduled workflow, otherwise use .ci/.matrix_framework.yml
frameworksFile: .ci/.matrix_framework${{ (github.event_name == 'schedule' || github.event_name == 'push' || inputs.full-matrix) && '_full' || '' }}.yml
excludedFile: .ci/.matrix_exclude.yml
- name: Split matrix
shell: python
id: split
run: |
import os
import json
def split(lst, n):
return [lst[i::n] for i in range(n)]
matrix = json.loads(os.environ['GENERATED_MATRIX'])
# Using the number 4 because the full matrix has roughly 400+ items
# Hence, it is split into chunks of size ~100
# We are doing this because the matrix in GH actions has a max limit of 256
chunks = split(matrix['include'], 4)
chunks_json = json.dumps(chunks)
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
print(f'chunks={chunks_json}', file=f)
env:
GENERATED_MATRIX: ${{ steps.generate.outputs.matrix }}
chunks-0:
needs: create-matrix
uses: ./.github/workflows/run-matrix.yml
with:
include: ${{ toJSON(fromJSON(needs.create-matrix.outputs.chunks)[0]) }}
chunks-1:
needs: create-matrix
uses: ./.github/workflows/run-matrix.yml
with:
include: ${{ toJSON(fromJSON(needs.create-matrix.outputs.chunks)[1]) }}
chunks-2:
needs: create-matrix
uses: ./.github/workflows/run-matrix.yml
with:
include: ${{ toJSON(fromJSON(needs.create-matrix.outputs.chunks)[2]) }}
chunks-3:
needs: create-matrix
uses: ./.github/workflows/run-matrix.yml
with:
include: ${{ toJSON(fromJSON(needs.create-matrix.outputs.chunks)[3]) }}
windows:
name: "windows (version: ${{ matrix.version }}, framework: ${{ matrix.framework }}, asyncio: ${{ matrix.asyncio }})"
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
include:
# - version: "3.6"
# framework: "none"
# asyncio: "true"
# - version: "3.7"
# framework: none
# asyncio: true
- version: "3.8"
framework: none
asyncio: true
- version: "3.9" # waiting for greenlet to have binary wheels for 3.9
framework: none
asyncio: true
env:
VERSION: ${{ matrix.version }}
FRAMEWORK: ${{ matrix.framework }}
ASYNCIO: ${{ matrix.asyncio }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
cache: pip
cache-dependency-path: "tests/requirements/reqs-${{ matrix.framework }}.txt"
- name: Install tools
run: .\scripts\install-tools.bat
- name: Run tests
run: .\scripts\run-tests.bat
- if: success() || failure()
name: Upload JUnit Test Results
uses: actions/upload-artifact@v3
with:
name: test-results
path: "**/*-python-agent-junit.xml"
- if: success() || failure()
name: Upload Coverage Reports
uses: actions/upload-artifact@v3
with:
name: coverage-reports
path: "**/.coverage*"
# This job is here to have a single status check that can be set as required.
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds
# If a run contains a series of jobs that need each other, a failure applies to all jobs in the dependency chain from the point of failure onwards.
all:
if: always()
runs-on: ubuntu-latest
needs:
- chunks-0
- chunks-1
- chunks-2
- chunks-3
- windows
steps:
- id: check
uses: elastic/apm-pipeline-library/.github/actions/check-dependent-jobs@current
with:
needs: ${{ toJSON(needs) }}
- run: ${{ steps.check.outputs.isSuccess }}
- if: failure() && (github.event_name == 'schedule' || github.event_name == 'push')
uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current
with:
status: ${{ steps.check.outputs.status }}
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
slackChannel: "#apm-agent-python"
coverage:
name: Combine & check coverage.
needs: all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- uses: actions/setup-python@v5
with:
# Use latest Python, so it understands all syntax.
python-version: 3.11
- run: python -Im pip install --upgrade coverage[toml]
- uses: actions/download-artifact@v3
with:
name: coverage-reports
- name: Combine coverage & fail if it's <84%.
run: |
python -Im coverage combine
python -Im coverage html --skip-covered --skip-empty
# Report and write to summary.
python -Im coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY
# Report again and fail if under 84%.
python -Im coverage report --fail-under=84
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-coverage-report
path: htmlcov
- uses: geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1
with:
name: coverage-reports