Skip to content

Bump the github-actions group across 1 directory with 10 updates #64

Bump the github-actions group across 1 directory with 10 updates

Bump the github-actions group across 1 directory with 10 updates #64

# Copyright 2024 Advanced Micro Devices, Inc.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: CI - amdsharktuner
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/ci-amdsharktuner.yml'
- 'amdsharktuner/**'
push:
branches: [ main ]
paths:
- '.github/workflows/ci-amdsharktuner.yml'
- 'amdsharktuner/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
test:
name: "Unit Tests (py${{ matrix.tuner-python-version }}, ${{ matrix.runs-on }})"
strategy:
matrix:
tuner-python-version: ["3.10.12"]
mypy-python-version: ["3.11"]
runs-on: [ubuntu-24.04]
runs-on: ${{matrix.runs-on}}
defaults:
run:
shell: bash
env:
PIP_CACHE_DIR: "${{ github.workspace }}/.pip-cache"
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Set up Python
id: setup_python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{matrix.tuner-python-version}}
- name: Cache pip packages
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
id: cache-pip
with:
path: ${{ env.PIP_CACHE_DIR }}
key: pip-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('amdsharktuner/requirements*.txt') }}
- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
pip install -r amdsharktuner/requirements-dev.txt
- name: Install amdsharktuner dependencies
run: |
pip install -r amdsharktuner/requirements-iree.txt
pip install -r amdsharktuner/requirements.txt
pip install --no-compile \
-r amdsharktuner/requirements-test.txt \
-e amdsharktuner/
pip freeze
- name: Run mypy type checker
run: mypy amdsharktuner --python-version ${{ matrix.mypy-python-version }}
- name: Run amdsharktuner tests with coverage
run: |
pytest amdsharktuner/ \
--cov=amdsharktuner \
--cov-report xml:amdsharktuner-cov.xml \
--cov-config=.coveragerc \
-v
env:
COVERAGE_FILE: .coverage.amdsharktuner
- name: Upload coverage data
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: coverage-data-amdsharktuner
path: .coverage.amdsharktuner
include-hidden-files: true
coverage:
name: Coverage
runs-on: ubuntu-24.04
needs: test
if: github.event.pull_request.number != 2677 # Skip for large PR that exceeds GitHub's 300-file diff limit
permissions:
pull-requests: write
contents: write
actions: read
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
id: download
with:
name: coverage-data-amdsharktuner
- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@e623398c19eb3853a5572d4a516e10b15b5cefbc # v3.39
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_COVERAGE_FILES: true
MINIMUM_GREEN: 90
MINIMUM_ORANGE: 70
- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
name: python-coverage-comment-action
path: python-coverage-comment-action.txt