Skip to content

Add Performance Thresholds to Test Runner #72

Add Performance Thresholds to Test Runner

Add Performance Thresholds to Test Runner #72

Workflow file for this run

# Copyright (c) 2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Test Runner CI
on:
merge_group: null
pull_request_target:
types: [opened, edited, reopened, synchronize]
branches: [main]
paths:
- 'test-runner/**'
push:
branches:
- main
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
unit-test:
runs-on: k8-runners
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: true
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref || github.ref }}
- uses: docker/setup-buildx-action@v3
with:
driver: docker
- uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install requirements
run: python -m pip install -U pip tox-gh-actions
- name: Tox
run: python -m tox
env:
CACHE_REGISTRY: ${{ secrets.CACHE_REGISTRY }}
FORCE_COLOR: 1
REGISTRY: ${{ secrets.REGISTRY }}
REPO: ${{ secrets.REPO }}
PERF_REPO: ${{ secrets.PERF_REPO }}
- uses: actions/upload-artifact@v4
with:
name: covdata-${{ matrix.python }}
path: ${{ github.workspace }}/.coverage*
coverage:
needs: [unit-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref || github.ref }}
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Coverage
run: |
python -m pip install coverage
python -m coverage combine --debug=pathmap
python -m coverage xml --skip-empty
- name: Comment on PR
uses: orgoro/[email protected]
with:
coverageFile: coverage.xml
token: ${{ secrets.ACTION_TOKEN }}
treshholdAll: 80
- uses: actions/upload-artifact@v4
with:
name: coverage.xml
path: coverage.xml
integration-test:
runs-on: k8-runners
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref || github.ref }}
- uses: docker/setup-buildx-action@v3
with:
driver: docker
- uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Test Container Group
uses: intel/ai-containers/test-runner@main
with:
cache_registry: ${{ secrets.CACHE_REGISTRY }}
perf_repo: ${{ secrets.PERF_REPO }}
recipe_dir: test-runner
registry: ${{ secrets.REGISTRY }}
repo: ${{ secrets.REPO }}
test_dir: test-runner
token: ${{ secrets.ACTION_TOKEN }}