feat: adding automated tests
This commit is contained in:
parent
e484f12228
commit
29ee360082
18 changed files with 2886 additions and 4 deletions
39
.forgejo/workflows/pr-tests.yml
Normal file
39
.forgejo/workflows/pr-tests.yml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
name: PR Tests
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: docker-arm64
|
||||
container:
|
||||
image: python:3.12-slim
|
||||
env:
|
||||
CMAKE_BUILD_PARALLEL_LEVEL: "4"
|
||||
steps:
|
||||
- name: Install system deps
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends \
|
||||
git ca-certificates \
|
||||
build-essential pkg-config
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
- name: Checkout
|
||||
run: |
|
||||
git config --global --add safe.directory "$PWD"
|
||||
git clone --depth=1 \
|
||||
"https://oauth2:${{ github.token }}@bitfreedom.net/code/${{ github.repository }}.git" .
|
||||
git fetch --depth=1 origin "+${{ github.event.pull_request.head.sha }}:pr"
|
||||
git checkout pr
|
||||
- name: Fetch action source
|
||||
run: |
|
||||
git clone --depth=1 --branch master \
|
||||
"https://oauth2:${{ github.token }}@bitfreedom.net/code/nomyo-ai/actions.git" \
|
||||
./.run-tests
|
||||
- uses: ./.run-tests/run-tests
|
||||
with:
|
||||
setup: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install -r test/requirements_test.txt
|
||||
command: pytest test/ -m "not integration" --cov=router --cov=cache --cov=db --cov=enhance --cov-fail-under=45 --cov-report=term-missing --cov-report=xml --junitxml=report.xml
|
||||
artifacts-path: |
|
||||
report.xml
|
||||
coverage.xml
|
||||
Loading…
Add table
Add a link
Reference in a new issue