mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
83 lines
3.0 KiB
YAML
83 lines
3.0 KiB
YAML
name: Gradido End-to-End Test CI
|
|
|
|
on: push
|
|
|
|
jobs:
|
|
end-to-end-tests:
|
|
name: End-to-End Tests
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: install bun
|
|
uses: oven-sh/setup-bun@v2
|
|
|
|
- name: Boot up test system | docker-compose mariadb mailserver
|
|
run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach mariadb mailserver
|
|
|
|
- name: Prepare test system
|
|
run: |
|
|
sudo chown runner:docker -R *
|
|
bun install
|
|
sudo cp ./nginx/gradido.conf /etc/nginx/sites-available/default
|
|
|
|
- name: wait for database to be ready
|
|
run: docker run --rm --network gradido_internal-net busybox sh -c 'until nc -z mariadb 3306; do echo waiting for db; sleep 1; done;'
|
|
|
|
- name: Boot up test system | seed backend
|
|
run: bun turbo seed
|
|
|
|
- name: Boot up test system | docker-compose backend, frontend
|
|
run: |
|
|
cd backend
|
|
cp .env.test_e2e .env
|
|
cd ..
|
|
bun turbo backend#dev frontend#dev &
|
|
|
|
- name: End-to-end tests | prepare
|
|
run: |
|
|
wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-386"
|
|
chmod +x /opt/cucumber-json-formatter
|
|
sudo ln -fs /opt/cucumber-json-formatter /usr/bin/cucumber-json-formatter
|
|
cd e2e-tests/
|
|
bun install
|
|
|
|
- name: wait for frontend and backend to be ready
|
|
run: |
|
|
docker run --rm --network gradido_internal-net busybox sh -c 'until nc -z 127.0.0.1 3000; do echo waiting for frontend; sleep 1; done;'
|
|
docker run --rm --network gradido_internal-net busybox sh -c 'until nc -z 127.0.0.1 4000; do echo waiting for backend; sleep 1; done;'
|
|
|
|
- name: Start local nginx webserver
|
|
run: |
|
|
sudo nginx -t
|
|
sudo systemctl start nginx
|
|
|
|
- name: wait for nginx to be ready
|
|
run: docker run --rm --network gradido_internal-net busybox sh -c 'until nc -z 127.0.0.1 80; do echo waiting for nginx; sleep 1; done;'
|
|
|
|
- name: End-to-end tests | run tests
|
|
id: e2e-tests
|
|
run: |
|
|
cd e2e-tests/
|
|
yarn run cypress run
|
|
|
|
- name: End-to-end tests | if tests failed, compile html report
|
|
if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }}
|
|
run: |
|
|
cd e2e-tests/
|
|
node create-cucumber-html-report.js
|
|
|
|
- name: End-to-end tests | if tests failed, get pr number
|
|
id: pr
|
|
if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }}
|
|
uses: 8BitJonny/gh-get-current-pr@2.2.0
|
|
|
|
- name: End-to-end tests | if tests failed, upload report
|
|
id: e2e-report
|
|
if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: cypress-report-pr-#${{ steps.pr.outputs.number }}
|
|
path: /home/runner/work/gradido/gradido/e2e-tests/cypress/reports/cucumber_html_report
|