Skip to content

v0.4.0-Beta

v0.4.0-Beta #8

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:
paths:
- 'test-runner/**'
push:
branches:
- main
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ 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
- 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:
FORCE_COLOR: 1
REGISTRY: ${{ secrets.REGISTRY }}
REPO: ${{ secrets.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
- 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
echo -e "\`\`\`markdown\n$(python -m coverage report -i -m)\n\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "total=$(python -m coverage report --format=total)" >> $GITHUB_ENV
- name: Update Badge
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: schneegans/[email protected]
with:
auth: ${{ secrets.ACTIONS_TOKEN }}
gistID: 48dea0fc9a908a6e5ba5c5e84123bc02
filename: coverage.json
label: Coverage
message: ${{ env.total }}%
minColorRange: 40
maxColorRange: 80
valColorRange: ${{ env.total }}
integration-test:
runs-on: k8-runners
steps:
- uses: actions/checkout@v4
- 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:
mlops_repo: ${{ github.repository }}
mlops_ref: ${{ github.ref }}
recipe_dir: test-runner
registry: ${{ secrets.REGISTRY }}
repo: ${{ secrets.REPO }}
test_dir: test-runner
token: ${{ secrets.ACTION_TOKEN || github.token }}