Skip to content

HSPC-179: Fix tests for hs-test-python #157

HSPC-179: Fix tests for hs-test-python

HSPC-179: Fix tests for hs-test-python #157

Workflow file for this run

name: CI
on:
push:
branches:
- master
- release
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
lint:
name: Lint with ruff
runs-on: arc-runners-small
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: ./.github/workflows/actions/prepare
with:
python-version: "3.11"
- name: Check files using the ruff formatter
run: |
poetry run ruff check --fix --unsafe-fixes --preview --exit-zero .
poetry run ruff format .
shell: bash
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
fetch: false
default_author: github_actions
message: 'Backend: Auto format'
add: '.'
mypy:
name: Static Type Checking
needs: lint
runs-on: arc-runners-small
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/prepare
with:
python-version: "3.12"
- name: Mypy
run: poetry run mypy .
shell: bash
test:
name: Run unit test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Ubuntu
- os: ubuntu-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"
# Windows
- os: windows-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.12"
# macOS (arm64)
- os: macos-14
python-version: "3.10"
- os: macos-14
python-version: "3.11"
- os: macos-14
python-version: "3.12"
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/prepare
with:
python-version: ${{ matrix.python-version }}
# Set environment variables for Windows
- name: Configure Windows environment
if: runner.os == 'Windows'
run: |
echo "PYTHONIOENCODING=utf-8" >> $GITHUB_ENV
echo "PYTHONUTF8=1" >> $GITHUB_ENV
echo "PYTHONLEGACYWINDOWSSTDIO=0" >> $GITHUB_ENV
shell: bash
- name: Run Tests
run: poetry run python tests/testing.py
shell: bash
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: 1
PYTHONLEGACYWINDOWSSTDIO: 0