CI: split workflow in 2 jobs
All checks were successful
/ test (push) Successful in 30s
/ build (push) Has been skipped

This commit is contained in:
phil 2024-11-03 02:18:01 +01:00
parent 51d131600e
commit 21bd7a904f

View file

@ -14,7 +14,7 @@ on:
type: boolean
jobs:
build:
test:
runs-on: container
container:
image: tiptop:5000/treetrail-backend-ci
@ -35,9 +35,32 @@ jobs:
- name: Install app with 'uv pip install'
run: uv pip install --python=$UV_PROJECT_ENVIRONMENT --no-deps .
- name: Run basic test (API call)
- name: Run tests (API call)
run: pytest -s tests/basic.py
build:
runs-on: container
if: ${{ inputs.build }}
container:
image: tiptop:5000/treetrail-backend-ci
volumes:
- "uv_cache:/root/.cache/uv"
- "ca-cert:/etc/containers/certs.d"
steps:
- uses: actions/checkout@v4
- name: Install app with 'uv pip install'
run: uv pip install --python=$UV_PROJECT_ENVIRONMENT --no-deps .
- name: Git unshallow - get all history from Git to get the tag for the computation of the version
if: ${{ inputs.build }}
run: git pull --unshallow
- name: Get the version from git
if: ${{ inputs.build }}
id: version
run: echo "version=$(git describe --dirty --tags)" >> $GITHUB_OUTPUT
- name: Workaround for bug of podman-login
if: ${{ inputs.build }}
run: |
@ -57,10 +80,10 @@ jobs:
if: ${{ inputs.build }}
uses: actions/buildah-build@v1
with:
image: treetrail-backend
image: "treetrail-backend:${{ steps.version.outputs.version }}"
#tags: foo # v1 ${{ github.sha }}
containerfiles: |
./Containerfile.for_runner
./Containerfile
- name: Push the image to the registry
uses: actions/push-to-registry@v2
@ -68,4 +91,4 @@ jobs:
with:
registry: "docker://${{ vars.REGISTRY }}"
image: treetrail-backend
tags: latest
tags: ${{ steps.version.outputs.version }}