Refactor CI/CD system based on latest standardization for upstreams #262
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Development | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
quality-checks: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Run quality checks | |
run: tox -e quality | |
type-checks: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Run quality checks | |
run: tox -e types | |
precommit-checks: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install pre-commit | |
- name: Run pre-commit checks | |
run: pre-commit run --all-files | |
unit-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Run unit tests | |
run: tox -e test-unit -- -m "smoke or sanity" | |
integration-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Run integration tests | |
run: tox -e test-integration -- -m smoke | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: pip install tox | |
- name: Build the package | |
run: | | |
export GUIDELLM_BUILD_TYPE=dev | |
export GUIDELLM_BUILD_ITERATION=${{ github.event.pull_request.number }} | |
tox -e build | |
- name: Upload build artifacts | |
id: artifact-upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts | |
path: dist/* | |
compression-level: 6 | |
if-no-files-found: error | |
retention-days: 30 | |
- name: Generate GitHub App token | |
id: app-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.GH_NM_REDHAT_AUTOMATION_APP_ID }} | |
private-key: ${{ secrets.GH_NM_REDHAT_AUTOMATION_APP_PRIVATE_KEY }} | |
- name: Comment Install instructions | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ steps.app-token.outputs.token }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `📦 **Build Artifacts Available** | |
The build artifacts (\`.whl\` and \`.tar.gz\`) have been successfully generated and are available for download: ${{ steps.artifact-upload.outputs.artifact-url }}. | |
They will be retained for **up to 30 days**. | |
` | |
}) |