Fix CI: remove upload-artifact (not supported on Gitea)
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 5s
Test / e2e-test (push) Has been cancelled
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 5s
Test / e2e-test (push) Has been cancelled
This commit is contained in:
@@ -11,16 +11,10 @@ jobs:
|
|||||||
run: cd frontend && npm ci
|
run: cd frontend && npm ci
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: cd frontend && npx vitest run --reporter=verbose --reporter=json --outputFile=test-results/vitest.json 2>&1 | tee test-results/vitest.log
|
run: |
|
||||||
shell: bash
|
cd frontend
|
||||||
|
npx vitest run --reporter=verbose 2>&1 | tee /tmp/vitest-${{ github.sha }}.log
|
||||||
- name: Upload unit test results
|
echo "Results saved to /tmp/vitest-${{ github.sha }}.log"
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: unit-test-results
|
|
||||||
path: frontend/test-results/
|
|
||||||
retention-days: 14
|
|
||||||
|
|
||||||
e2e-test:
|
e2e-test:
|
||||||
runs-on: test
|
runs-on: test
|
||||||
@@ -28,51 +22,34 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install frontend dependencies
|
- name: Install frontend
|
||||||
run: cd frontend && npm ci
|
run: cd frontend && npm ci
|
||||||
|
|
||||||
- name: Install backend dependencies
|
- name: Install backend
|
||||||
run: python3 -m venv .venv && . .venv/bin/activate && pip install -q -r backend/requirements.txt
|
run: python3 -m venv /tmp/ci-venv-$$ && . /tmp/ci-venv-$$/bin/activate && pip install -q -r backend/requirements.txt
|
||||||
|
|
||||||
- name: Start backend
|
- name: Start servers
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate
|
. /tmp/ci-venv-*/bin/activate
|
||||||
DB_PATH=/tmp/ci_oil_test_$$.db FRONTEND_DIR=/dev/null \
|
DB_PATH=/tmp/ci_oil_${{ github.run_id }}.db FRONTEND_DIR=/dev/null \
|
||||||
nohup uvicorn backend.main:app --port 8000 > /tmp/backend.log 2>&1 &
|
nohup uvicorn backend.main:app --port 8000 > /tmp/backend.log 2>&1 &
|
||||||
sleep 3
|
|
||||||
curl -sf http://localhost:8000/api/version
|
|
||||||
|
|
||||||
- name: Start frontend
|
|
||||||
run: |
|
|
||||||
cd frontend && nohup npx vite --port 5173 > /tmp/frontend.log 2>&1 &
|
cd frontend && nohup npx vite --port 5173 > /tmp/frontend.log 2>&1 &
|
||||||
sleep 3
|
sleep 4
|
||||||
|
curl -sf http://localhost:8000/api/version
|
||||||
curl -sf -o /dev/null http://localhost:5173/
|
curl -sf -o /dev/null http://localhost:5173/
|
||||||
|
|
||||||
- name: Run E2E tests
|
- name: Run E2E tests
|
||||||
run: |
|
run: |
|
||||||
cd frontend
|
cd frontend
|
||||||
npx cypress run \
|
SPECS=$(ls cypress/e2e/*.cy.js | grep -v demo | grep -v visual | grep -v check | tr '\n' ',')
|
||||||
--spec "$(ls cypress/e2e/*.cy.js | grep -v demo | grep -v visual | grep -v check | tr '\n' ',')" \
|
npx cypress run --spec "$SPECS" --config video=false 2>&1 | tee /tmp/cypress-${{ github.sha }}.log
|
||||||
--config video=true,screenshotOnRunFailure=true \
|
|
||||||
2>&1 | tee cypress/test-results.log
|
|
||||||
|
|
||||||
- name: Upload E2E results
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: e2e-test-results
|
|
||||||
path: |
|
|
||||||
frontend/cypress/videos/
|
|
||||||
frontend/cypress/screenshots/
|
|
||||||
frontend/cypress/test-results.log
|
|
||||||
retention-days: 14
|
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
pkill -f "uvicorn backend" || true
|
pkill -f "uvicorn backend" || true
|
||||||
pkill -f "node.*vite" || true
|
pkill -f "node.*vite" || true
|
||||||
rm -f /tmp/ci_oil_test_*.db
|
rm -f /tmp/ci_oil_${{ github.run_id }}.db
|
||||||
|
|
||||||
build-check:
|
build-check:
|
||||||
runs-on: test
|
runs-on: test
|
||||||
|
|||||||
Reference in New Issue
Block a user