CI / lint (pull_request) Failing after 31s
CI / test (3.11) (pull_request) Skipped
CI / test (3.12) (pull_request) Skipped
CI / test (3.13) (pull_request) Skipped
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Skipped
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Skipped
CI / test-with-coverage (pull_request) Skipped
132 lines
3.3 KiB
YAML
132 lines
3.3 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Setup
|
|
uses: ./.gitea/actions/install
|
|
with:
|
|
python_version: "3.12"
|
|
index_username: ${{ secrets.GITEA_USER }}
|
|
index_password: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Format
|
|
run: |
|
|
source .venv/bin/activate
|
|
ruff format --check
|
|
|
|
- name: Lint
|
|
run: |
|
|
source .venv/bin/activate
|
|
ruff check
|
|
|
|
- name: Checkout pyright diff plugin
|
|
uses: actions/checkout@v5
|
|
with:
|
|
repository: mx/diff_quality_basedpyright
|
|
path: diff_quality_basedpyright
|
|
|
|
- name: Typecheck Diff
|
|
run: |
|
|
source .venv/bin/activate
|
|
uv pip install -e diff_quality_basedpyright
|
|
diff-quality --violations=basedpyright
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
needs: "lint"
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.11", "3.12", "3.13"]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Setup
|
|
uses: ./.gitea/actions/install
|
|
with:
|
|
python_version: ${{ matrix.python-version }}
|
|
index_username: ${{ secrets.GITEA_USER }}
|
|
index_password: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Run Pytest
|
|
env:
|
|
QT_QPA_PLATFORM: offscreen
|
|
BEAMLINE: SIMULATED
|
|
run: |
|
|
source .venv/bin/activate
|
|
pytest ./tests/unit
|
|
|
|
test-with-beamline-plugins:
|
|
runs-on: ubuntu-latest
|
|
needs: ["lint", "test"]
|
|
strategy:
|
|
matrix:
|
|
plugin_repo: ["pxi_bec", "pxii_bec", "pxiii_bec"]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Setup
|
|
uses: ./.gitea/actions/install
|
|
with:
|
|
python_version: "3.12"
|
|
index_username: ${{ secrets.GITEA_USER }}
|
|
index_password: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Install beamline plugin
|
|
run: |
|
|
source .venv/bin/activate
|
|
git clone https://gitea.psi.ch/bec/mx_bec.git
|
|
git clone https://gitea.psi.ch/bec/${{ matrix.plugin_repo }}.git
|
|
uv pip install -e ./mx_bec
|
|
uv pip install -e ./${{ matrix.plugin_repo }}
|
|
|
|
- name: Run Pytest
|
|
env:
|
|
QT_QPA_PLATFORM: offscreen
|
|
BEAMLINE: SIMULATED
|
|
run: |
|
|
source .venv/bin/activate
|
|
pytest ./tests/unit
|
|
|
|
test-with-coverage:
|
|
runs-on: ubuntu-latest
|
|
needs: ["lint", "test", "test-with-beamline-plugins"]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Setup
|
|
uses: ./.gitea/actions/install
|
|
with:
|
|
python_version: "3.12"
|
|
index_username: ${{ secrets.GITEA_USER }}
|
|
index_password: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Run Pytest with Coverage
|
|
env:
|
|
QT_QPA_PLATFORM: offscreen
|
|
BEAMLINE: SIMULATED
|
|
run: |
|
|
source .venv/bin/activate
|
|
pytest --cov=aare --cov-config=./pyproject.toml --cov-branch --cov-report=xml --no-cov-on-fail ./tests/unit
|