mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-27 19:25:15 +02:00
chore: streamline GitHub Actions workflow by removing change detection job and simplifying test conditions
This commit is contained in:
parent
844b8ba609
commit
a6a0f7a373
1 changed files with 8 additions and 41 deletions
49
.github/workflows/backend-tests.yml
vendored
49
.github/workflows/backend-tests.yml
vendored
|
|
@ -4,36 +4,19 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main, dev]
|
branches: [main, dev]
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
|
paths:
|
||||||
|
- 'surfsense_backend/**'
|
||||||
|
- '.github/workflows/backend-tests.yml'
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
changes:
|
|
||||||
name: Changes
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
backend: ${{ steps.filter.outputs.backend }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Check changed files
|
|
||||||
id: filter
|
|
||||||
uses: dorny/paths-filter@v4
|
|
||||||
with:
|
|
||||||
filters: |
|
|
||||||
backend:
|
|
||||||
- 'surfsense_backend/**'
|
|
||||||
- '.github/workflows/backend-tests.yml'
|
|
||||||
|
|
||||||
unit-tests:
|
unit-tests:
|
||||||
name: Unit Tests
|
name: Unit Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: changes
|
if: github.event.pull_request.draft == false
|
||||||
if: ${{ github.event.pull_request.draft == false && needs.changes.outputs.backend == 'true' }}
|
|
||||||
env:
|
env:
|
||||||
EMBEDDING_MODEL: sentence-transformers/all-MiniLM-L6-v2
|
EMBEDDING_MODEL: sentence-transformers/all-MiniLM-L6-v2
|
||||||
|
|
||||||
|
|
@ -76,8 +59,7 @@ jobs:
|
||||||
integration-tests:
|
integration-tests:
|
||||||
name: Integration Tests
|
name: Integration Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: changes
|
if: github.event.pull_request.draft == false
|
||||||
if: ${{ github.event.pull_request.draft == false && needs.changes.outputs.backend == 'true' }}
|
|
||||||
env:
|
env:
|
||||||
EMBEDDING_MODEL: sentence-transformers/all-MiniLM-L6-v2
|
EMBEDDING_MODEL: sentence-transformers/all-MiniLM-L6-v2
|
||||||
|
|
||||||
|
|
@ -139,29 +121,14 @@ jobs:
|
||||||
test-gate:
|
test-gate:
|
||||||
name: Test Gate
|
name: Test Gate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [changes, unit-tests, integration-tests]
|
needs: [unit-tests, integration-tests]
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check all test jobs
|
- name: Check all test jobs
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ needs.changes.result }}" == "failure" || "${{ needs.changes.result }}" == "cancelled" ]]; then
|
if [[ "${{ needs.unit-tests.result }}" == "failure" ||
|
||||||
echo "Backend change detection failed"
|
"${{ needs.integration-tests.result }}" == "failure" ]]; then
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then
|
|
||||||
echo "Draft PR; backend tests skipped"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${{ needs.changes.outputs.backend }}" != "true" ]]; then
|
|
||||||
echo "No backend changes detected; backend tests skipped"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${{ needs.unit-tests.result }}" != "success" ||
|
|
||||||
"${{ needs.integration-tests.result }}" != "success" ]]; then
|
|
||||||
echo "Backend tests failed"
|
echo "Backend tests failed"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue