Skip to content

Set up core framework pieces such as configs for eslint, typescript, prettier, husky precommit hook, basic GHA #420

Set up core framework pieces such as configs for eslint, typescript, prettier, husky precommit hook, basic GHA

Set up core framework pieces such as configs for eslint, typescript, prettier, husky precommit hook, basic GHA #420

Workflow file for this run

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
ui-quality-checks:
permissions:
contents: "read"
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install dependencies
run: npm ci
working-directory: src/ui
- name: Run quality and typing checks
run: npm run lint
working-directory: src/ui
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
ui-type-checks:
permissions:
contents: "read"
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install dependencies
run: npm ci
working-directory: src/ui
- name: Run quality and typing checks
run: npm run type-check
working-directory: src/ui
precommit-checks:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9"]
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
ui-precommit-check:
permissions:
contents: "read"
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install dependencies
working-directory: src/ui
run: npm ci
- name: Run pre-commit checks
run: npx husky run pre-commit
working-directory: src/ui
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**.
`
})