New split workflows.
Test Code / test-backend (push) Successful in 6s
Test Code / test-frontend (push) Successful in 12s
Build Release / tests (release) Failing after 1s
Build Release / build-docker (backend) (release) Successful in 8s
Build Release / build-docker (frontend) (release) Successful in 9s
Test Code / test-backend (push) Successful in 6s
Test Code / test-frontend (push) Successful in 12s
Build Release / tests (release) Failing after 1s
Build Release / build-docker (backend) (release) Successful in 8s
Build Release / build-docker (frontend) (release) Successful in 9s
This commit is contained in:
@@ -1,47 +1,22 @@
|
|||||||
name: CI/CD Pipeline
|
name: Build Release
|
||||||
|
|
||||||
on:
|
on: [release]
|
||||||
push:
|
|
||||||
branches: ["main"] # Runs tests on every push to main
|
|
||||||
release:
|
|
||||||
types: [published] # Runs builds only when a release is published
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# 1. Run tests on every push to main
|
tests:
|
||||||
test-backend:
|
uses: ./.gitea/workflows/tests.yml
|
||||||
if: github.event_name == 'push'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: python:3.14
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Run Tests
|
|
||||||
run: |
|
|
||||||
cd backend
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pytest
|
|
||||||
|
|
||||||
test-frontend:
|
|
||||||
if: github.event_name == 'push'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: node:alpine
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Run Tests
|
|
||||||
run: |
|
|
||||||
cd frontend
|
|
||||||
npm ci
|
|
||||||
npm test -- run --exclude "**/*.live.test.ts"
|
|
||||||
|
|
||||||
# 2. Build Docker images only on release
|
|
||||||
build-docker:
|
build-docker:
|
||||||
if: github.event_name == 'release'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
service: [backend, frontend]
|
service: [backend, frontend]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Log in to Registry
|
- name: Log in to Registry
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
name: Test Code
|
||||||
|
|
||||||
|
on: [push, workflow_call, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test-backend:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
cd backend
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
- name: Test with pytest
|
||||||
|
run: |
|
||||||
|
cd backend
|
||||||
|
pip install pytest pytest-cov
|
||||||
|
pytest
|
||||||
|
|
||||||
|
test-frontend:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "20.x"
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
cd frontend
|
||||||
|
npm ci
|
||||||
|
- name: Test with NPM
|
||||||
|
run: |
|
||||||
|
cd frontend
|
||||||
|
npm test -- run --exclude "**/*.live.test.ts"
|
||||||
Reference in New Issue
Block a user