mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-21 17:06:18 +00:00
* ci: upgrade actions * chore: improve exception handling * fix: incorect url behind proxy
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
name: test
|
|
on:
|
|
push:
|
|
branches: [ master, develop ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Set up python
|
|
id: setup-python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.11
|
|
- uses: actions/checkout@v6
|
|
- name: Load cached venv
|
|
id: cached-poetry-dependencies
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: .venv
|
|
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install poetry
|
|
sudo apt-get install libblas3 liblapack3 liblapack-dev libblas-dev gfortran libatlas-base-dev
|
|
poetry config --local virtualenvs.in-project true
|
|
poetry install --no-interaction
|
|
- name: check quality
|
|
run: |
|
|
source .venv/bin/activate
|
|
pre-commit run -a
|
|
- name: test app
|
|
env:
|
|
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
|
run: |
|
|
echo Test
|
|
source .venv/bin/activate
|
|
coverage run -m unittest || exit 11
|
|
coverage combine
|
|
coverage report
|
|
if [ -n "$CODACY_PROJECT_TOKEN" ]; then
|
|
coverage xml -o cobertura.xml
|
|
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r cobertura.xml
|
|
else
|
|
echo no CODACY_PROJECT_TOKEN
|
|
fi
|