CI: split test and build workflows, run build only on git push tag
This commit is contained in:
parent
d0c7e4614a
commit
727698527e
2 changed files with 36 additions and 5 deletions
|
@ -1,5 +1,7 @@
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- "**"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
verbose:
|
||||
|
@ -7,11 +9,6 @@ on:
|
|||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
build:
|
||||
description: "Build container"
|
||||
required: true
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
test:
|
34
.forgejo/workflows/test.yaml
Normal file
34
.forgejo/workflows/test.yaml
Normal file
|
@ -0,0 +1,34 @@
|
|||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
verbose:
|
||||
description: "Verbose"
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: container
|
||||
container:
|
||||
image: code.philo.ydns.eu/philorg/treetrail-backend-ci
|
||||
volumes:
|
||||
- "uv_cache:/root/.cache/uv"
|
||||
- "ca-cert:/etc/containers/certs.d"
|
||||
services:
|
||||
treetrail-database:
|
||||
image: code.philo.ydns.eu/philorg/treetrail-database
|
||||
steps:
|
||||
- name: Echo env
|
||||
if: ${{ inputs.verbose }}
|
||||
run: |
|
||||
echo '${{ toJSON(env) }}'
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install app with 'uv pip install'
|
||||
run: uv pip install --python=$UV_PROJECT_ENVIRONMENT --no-deps .
|
||||
|
||||
- name: Run tests (API call)
|
||||
run: pytest -s tests/basic.py
|
Loading…
Add table
Add a link
Reference in a new issue