19e179dd20
Unified application CI and deployment / static-checks (push) Successful in 5s
Remote development preview source sync / sync-source (push) Failing after 17s
python CI and deployment / static-checks (push) Successful in 4s
Unified application CI and deployment / static-checks (pull_request) Successful in 5s
python CI and deployment / static-checks (pull_request) Successful in 4s
Unified application CI and deployment / verify-and-release (push) Has been skipped
python CI and deployment / verify-and-deploy (push) Has been skipped
Unified application CI and deployment / verify-and-release (pull_request) Has been skipped
python CI and deployment / verify-and-deploy (pull_request) Has been skipped
45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
name: python CI and deployment
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- '.dockerignore'
|
|
- 'apps/python/**'
|
|
- 'scripts/deploy-python.sh'
|
|
- '.gitea/workflows/python.yml'
|
|
push:
|
|
branches: ["**"]
|
|
paths:
|
|
- '.dockerignore'
|
|
- 'apps/python/**'
|
|
- 'scripts/deploy-python.sh'
|
|
- '.gitea/workflows/python.yml'
|
|
|
|
jobs:
|
|
static-checks:
|
|
runs-on: ces-control
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 2
|
|
- name: Check Python and deployment syntax without executing tests
|
|
run: |
|
|
git diff --check HEAD^ HEAD
|
|
bash -n scripts/deploy-python.sh
|
|
python3 -c 'import ast,pathlib; [ast.parse(p.read_text(),filename=str(p)) for p in pathlib.Path("apps/python").rglob("*.py")]'
|
|
verify-and-deploy:
|
|
needs: static-checks
|
|
if: gitea.ref == 'refs/heads/main' && gitea.event_name == 'push'
|
|
runs-on: ces-control
|
|
timeout-minutes: 45
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Build and verify python
|
|
run: docker build -f apps/python/Dockerfile -t "prompt-python:${{ gitea.sha }}" .
|
|
- name: Release python
|
|
if: gitea.ref == 'refs/heads/main' && gitea.event_name == 'push'
|
|
run: bash scripts/deploy-python.sh "${{ gitea.sha }}"
|