Files
AareDAQ/.gitea/workflows/ci.yml
T
perl_d 0c55bc8008
CI / lint (pull_request) Successful in 30s
CI / test (3.11) (pull_request) Successful in 44s
CI / test (3.12) (pull_request) Successful in 48s
CI / test (3.13) (pull_request) Successful in 1m15s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 53s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m57s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 2m12s
CI / test-with-coverage (pull_request) Successful in 1m29s
ci: run on push only for main, otherwise PR
2026-07-31 12:08:16 +02:00

111 lines
2.7 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
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
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